Calls cannot be tail in the scope of a to-be-closed variable
A to-be-closed variable must be closed when a block ends, so even a 'return foo()' cannot directly returns the results of 'foo'; the function must close the scope before returning.
This commit is contained in:
2
lvm.c
2
lvm.c
@@ -1565,7 +1565,7 @@ void luaV_execute (lua_State *L, CallInfo *ci) {
|
||||
if (nparams1) /* vararg function? */
|
||||
delta = ci->u.l.nextraargs + nparams1;
|
||||
/* close upvalues from current call */
|
||||
ProtectNT(luaF_close(L, base, LUA_OK));
|
||||
luaF_close(L, base, -1); /* (no to-be-closed vars. here) */
|
||||
updatestack(ci);
|
||||
}
|
||||
if (!ttisfunction(s2v(ra))) { /* not a function? */
|
||||
|
||||
Reference in New Issue
Block a user