SETLIST extra argument now is an "instruction" (OP_EXTRAARG)

This commit is contained in:
Roberto Ierusalimschy
2008-04-02 14:38:54 -03:00
parent 5627d51e05
commit a4d3080fe3
6 changed files with 68 additions and 36 deletions

11
lvm.c
View File

@@ -1,5 +1,5 @@
/*
** $Id: lvm.c,v 2.72 2007/06/19 19:48:15 roberto Exp roberto $
** $Id: lvm.c,v 2.73 2007/09/10 17:59:32 roberto Exp roberto $
** Lua virtual machine
** See Copyright Notice in lua.h
*/
@@ -704,7 +704,10 @@ void luaV_execute (lua_State *L, int nexeccalls) {
int last;
Table *h;
if (n == 0) n = cast_int(L->top - ra) - 1;
if (c == 0) c = cast_int(*L->savedpc++);
if (c == 0) {
lua_assert(GET_OPCODE(*L->savedpc) == OP_EXTRAARG);
c = GETARG_Ax(*L->savedpc++);
}
runtime_check(L, ttistable(ra));
h = hvalue(ra);
last = ((c-1)*LFIELDS_PER_FLUSH) + n;
@@ -764,6 +767,10 @@ void luaV_execute (lua_State *L, int nexeccalls) {
}
continue;
}
case OP_EXTRAARG: {
luaG_runerror(L, "bad opcode");
return;
}
}
}
}