diff options
author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2018-12-04 15:01:42 -0200 |
---|---|---|
committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2018-12-04 15:01:42 -0200 |
commit | 28d829c86712ce5bc453feccc5129a32f78d80c0 (patch) | |
tree | 58197e763ca643bbe4a042372927bf81092b141c /lvm.c | |
parent | 6d04537ea660fd12fc16c328366b701fabaf4919 (diff) | |
download | lua-28d829c86712ce5bc453feccc5129a32f78d80c0.tar.gz lua-28d829c86712ce5bc453feccc5129a32f78d80c0.tar.bz2 lua-28d829c86712ce5bc453feccc5129a32f78d80c0.zip |
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.
Diffstat (limited to 'lvm.c')
-rw-r--r-- | lvm.c | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -1565,7 +1565,7 @@ void luaV_execute (lua_State *L, CallInfo *ci) { | |||
1565 | if (nparams1) /* vararg function? */ | 1565 | if (nparams1) /* vararg function? */ |
1566 | delta = ci->u.l.nextraargs + nparams1; | 1566 | delta = ci->u.l.nextraargs + nparams1; |
1567 | /* close upvalues from current call */ | 1567 | /* close upvalues from current call */ |
1568 | ProtectNT(luaF_close(L, base, LUA_OK)); | 1568 | luaF_close(L, base, -1); /* (no to-be-closed vars. here) */ |
1569 | updatestack(ci); | 1569 | updatestack(ci); |
1570 | } | 1570 | } |
1571 | if (!ttisfunction(s2v(ra))) { /* not a function? */ | 1571 | if (!ttisfunction(s2v(ra))) { /* not a function? */ |