New implementation for to-be-closed variables
To-be-closed variables are linked in their own list, embedded into the stack elements. (Due to alignment, this information does not change the size of the stack elements in most architectures.) This new list does not produce garbage and avoids memory errors when creating tbc variables.
This commit is contained in:
6
lvm.c
6
lvm.c
@@ -1635,10 +1635,8 @@ void luaV_execute (lua_State *L, CallInfo *ci) {
|
||||
b = cast_int(L->top - ra);
|
||||
savepc(ci); /* several calls here can raise errors */
|
||||
if (TESTARG_k(i)) {
|
||||
/* close upvalues from current call; the compiler ensures
|
||||
that there are no to-be-closed variables here, so this
|
||||
call cannot change the stack */
|
||||
luaF_close(L, base, NOCLOSINGMETH, 0);
|
||||
luaF_closeupval(L, base); /* close upvalues from current call */
|
||||
lua_assert(L->tbclist < base); /* no pending tbc variables */
|
||||
lua_assert(base == ci->func + 1);
|
||||
}
|
||||
while (!ttisfunction(s2v(ra))) { /* not a function? */
|
||||
|
||||
Reference in New Issue
Block a user