From 28d829c86712ce5bc453feccc5129a32f78d80c0 Mon Sep 17 00:00:00 2001 From: Roberto Ierusalimschy Date: Tue, 4 Dec 2018 15:01:42 -0200 Subject: 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. --- lvm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lvm.c') diff --git a/lvm.c b/lvm.c index 50d967c6..fc8722a8 100644 --- a/lvm.c +++ b/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? */ -- cgit v1.2.3-55-g6feb