diff options
author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2010-01-15 14:23:58 -0200 |
---|---|---|
committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2010-01-15 14:23:58 -0200 |
commit | 36ab1ee10c557efe625bfab76eeea9fc6e0b7ab9 (patch) | |
tree | fc9063947ce9454323d52d39d7838366f6e24019 /lvm.c | |
parent | 193ce46970dda16e129ebb28cae085ecf469d702 (diff) | |
download | lua-36ab1ee10c557efe625bfab76eeea9fc6e0b7ab9.tar.gz lua-36ab1ee10c557efe625bfab76eeea9fc6e0b7ab9.tar.bz2 lua-36ab1ee10c557efe625bfab76eeea9fc6e0b7ab9.zip |
__unm metamethod gets nil as its 2nd parameter
Diffstat (limited to 'lvm.c')
-rw-r--r-- | lvm.c | 3 |
1 files changed, 2 insertions, 1 deletions
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | ** $Id: lvm.c,v 2.101 2009/11/25 15:27:51 roberto Exp roberto $ | 2 | ** $Id: lvm.c,v 2.102 2009/12/17 16:20:01 roberto Exp roberto $ |
3 | ** Lua virtual machine | 3 | ** Lua virtual machine |
4 | ** See Copyright Notice in lua.h | 4 | ** See Copyright Notice in lua.h |
5 | */ | 5 | */ |
@@ -157,6 +157,7 @@ static int call_binTM (lua_State *L, const TValue *p1, const TValue *p2, | |||
157 | if (ttisnil(tm)) | 157 | if (ttisnil(tm)) |
158 | tm = luaT_gettmbyobj(L, p2, event); /* try second operand */ | 158 | tm = luaT_gettmbyobj(L, p2, event); /* try second operand */ |
159 | if (ttisnil(tm)) return 0; | 159 | if (ttisnil(tm)) return 0; |
160 | if (event == TM_UNM) p2 = luaO_nilobject; | ||
160 | callTM(L, tm, p1, p2, res, 1); | 161 | callTM(L, tm, p1, p2, res, 1); |
161 | return 1; | 162 | return 1; |
162 | } | 163 | } |