This commit is contained in:
Roberto Ierusalimschy 2006-07-14 13:22:24 -03:00
parent 3fa47c5dc1
commit fa0c03aaa6
1 changed files with 6 additions and 6 deletions

12
lvm.c
View File

@ -1,5 +1,5 @@
/* /*
** $Id: lvm.c,v 2.63 2006/06/05 15:58:59 roberto Exp roberto $ ** $Id: lvm.c,v 2.65 2006/07/14 14:40:12 roberto Exp $
** Lua virtual machine ** Lua virtual machine
** See Copyright Notice in lua.h ** See Copyright Notice in lua.h
*/ */
@ -455,12 +455,12 @@ void luaV_execute (lua_State *L, int nexeccalls) {
continue; continue;
} }
case OP_NEWTABLE: { case OP_NEWTABLE: {
int asize = luaO_fb2int(GETARG_B(i)); int b = GETARG_B(i);
int nsize = luaO_fb2int(GETARG_C(i)); int c = GETARG_C(i);
Table *t = luaH_new(L); Table *t = luaH_new(L);
sethvalue(L, ra, t); sethvalue(L, ra, t);
if (asize > 0 || nsize > 0) if (b != 0 || c != 0)
luaH_resize(L, t, asize, nsize); luaH_resize(L, t, luaO_fb2int(b), luaO_fb2int(c));
Protect(luaC_checkGC(L)); Protect(luaC_checkGC(L));
continue; continue;
} }
@ -523,7 +523,7 @@ void luaV_execute (lua_State *L, int nexeccalls) {
} }
default: { /* try metamethod */ default: { /* try metamethod */
Protect( Protect(
if (!call_binTM(L, rb, luaO_nilobject, ra, TM_LEN)) if (!call_binTM(L, rb, rb, ra, TM_LEN))
luaG_typeerror(L, rb, "get length of"); luaG_typeerror(L, rb, "get length of");
) )
} }