lua

A copy of the Lua development repository
Log | Files | Refs | README

commit 0fb1644c6070daada206fc091f45b4bc39381ea2
parent 119d5e46d576c43bf8828b67092b3450a749af08
Author: Roberto Ierusalimschy <roberto@inf.puc-rio.br>
Date:   Tue,  5 Apr 2011 11:25:59 -0300

 2nd operand for unary tag methods does not need to be 'nil'

Diffstat:
Mlvm.c | 5++---
1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/lvm.c b/lvm.c @@ -1,5 +1,5 @@ /* -** $Id: lvm.c,v 2.130 2011/02/07 12:24:42 roberto Exp roberto $ +** $Id: lvm.c,v 2.131 2011/02/07 19:15:24 roberto Exp roberto $ ** Lua virtual machine ** See Copyright Notice in lua.h */ @@ -161,7 +161,6 @@ static int call_binTM (lua_State *L, const TValue *p1, const TValue *p2, if (ttisnil(tm)) tm = luaT_gettmbyobj(L, p2, event); /* try second operand */ if (ttisnil(tm)) return 0; - if (event == TM_UNM) p2 = luaO_nilobject; callTM(L, tm, p1, p2, res, 1); return 1; } @@ -328,7 +327,7 @@ void luaV_objlen (lua_State *L, StkId ra, const TValue *rb) { break; } } - callTM(L, tm, rb, luaO_nilobject, ra, 1); + callTM(L, tm, rb, rb, ra, 1); }