diff options
author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2011-04-05 11:26:23 -0300 |
---|---|---|
committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2011-04-05 11:26:23 -0300 |
commit | 0fb1644c6070daada206fc091f45b4bc39381ea2 (patch) | |
tree | 0199e746e6dca9d6d32d7057b385c0c3cf62ddb9 | |
parent | 119d5e46d576c43bf8828b67092b3450a749af08 (diff) | |
download | lua-0fb1644c6070daada206fc091f45b4bc39381ea2.tar.gz lua-0fb1644c6070daada206fc091f45b4bc39381ea2.tar.bz2 lua-0fb1644c6070daada206fc091f45b4bc39381ea2.zip |
2nd operand for unary tag methods does not need to be 'nil'
-rw-r--r-- | lvm.c | 5 |
1 files changed, 2 insertions, 3 deletions
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | ** $Id: lvm.c,v 2.130 2011/02/07 12:24:42 roberto Exp roberto $ | 2 | ** $Id: lvm.c,v 2.131 2011/02/07 19:15:24 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 | */ |
@@ -161,7 +161,6 @@ static int call_binTM (lua_State *L, const TValue *p1, const TValue *p2, | |||
161 | if (ttisnil(tm)) | 161 | if (ttisnil(tm)) |
162 | tm = luaT_gettmbyobj(L, p2, event); /* try second operand */ | 162 | tm = luaT_gettmbyobj(L, p2, event); /* try second operand */ |
163 | if (ttisnil(tm)) return 0; | 163 | if (ttisnil(tm)) return 0; |
164 | if (event == TM_UNM) p2 = luaO_nilobject; | ||
165 | callTM(L, tm, p1, p2, res, 1); | 164 | callTM(L, tm, p1, p2, res, 1); |
166 | return 1; | 165 | return 1; |
167 | } | 166 | } |
@@ -328,7 +327,7 @@ void luaV_objlen (lua_State *L, StkId ra, const TValue *rb) { | |||
328 | break; | 327 | break; |
329 | } | 328 | } |
330 | } | 329 | } |
331 | callTM(L, tm, rb, luaO_nilobject, ra, 1); | 330 | callTM(L, tm, rb, rb, ra, 1); |
332 | } | 331 | } |
333 | 332 | ||
334 | 333 | ||