mirror of
https://github.com/lua/lua
synced 2025-01-22 17:12:05 +03:00
__unm metamethod gets nil as its 2nd parameter
This commit is contained in:
parent
193ce46970
commit
36ab1ee10c
3
lvm.c
3
lvm.c
@ -1,5 +1,5 @@
|
||||
/*
|
||||
** $Id: lvm.c,v 2.101 2009/11/25 15:27:51 roberto Exp roberto $
|
||||
** $Id: lvm.c,v 2.102 2009/12/17 16:20:01 roberto Exp roberto $
|
||||
** Lua virtual machine
|
||||
** See Copyright Notice in lua.h
|
||||
*/
|
||||
@ -157,6 +157,7 @@ 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;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user