diff options
author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2015-05-22 14:48:19 -0300 |
---|---|---|
committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2015-05-22 14:48:19 -0300 |
commit | d39bb51faaa0467ad6a0f5b4ee2ee8400d620727 (patch) | |
tree | 64d49afe6eb909412693c5e1c7498571aaa947ff /lvm.c | |
parent | 6142e663e4d3180d2afaea50bd0978a040f518a4 (diff) | |
download | lua-d39bb51faaa0467ad6a0f5b4ee2ee8400d620727.tar.gz lua-d39bb51faaa0467ad6a0f5b4ee2ee8400d620727.tar.bz2 lua-d39bb51faaa0467ad6a0f5b4ee2ee8400d620727.zip |
bug: interpreter cannot pop activation frame before calling return
hook (as it may want to access local variables active by the end
of the function)
Diffstat (limited to 'lvm.c')
-rw-r--r-- | lvm.c | 5 |
1 files changed, 2 insertions, 3 deletions
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | ** $Id: lvm.c,v 2.241 2015/05/20 16:22:55 roberto Exp roberto $ | 2 | ** $Id: lvm.c,v 2.242 2015/05/20 18:19:11 roberto Exp roberto $ |
3 | ** Lua virtual machine | 3 | ** Lua virtual machine |
4 | ** See Copyright Notice in lua.h | 4 | ** See Copyright Notice in lua.h |
5 | */ | 5 | */ |
@@ -1106,9 +1106,8 @@ void luaV_execute (lua_State *L) { | |||
1106 | } | 1106 | } |
1107 | vmcase(OP_RETURN) { | 1107 | vmcase(OP_RETURN) { |
1108 | int b = GETARG_B(i); | 1108 | int b = GETARG_B(i); |
1109 | if (b != 0) L->top = ra+b-1; | ||
1110 | if (cl->p->sizep > 0) luaF_close(L, base); | 1109 | if (cl->p->sizep > 0) luaF_close(L, base); |
1111 | b = luaD_poscall(L, ra); | 1110 | b = luaD_poscall(L, ra, (b != 0 ? b - 1 : L->top - ra)); |
1112 | if (!(ci->callstatus & CIST_REENTRY)) /* 'ci' still the called one */ | 1111 | if (!(ci->callstatus & CIST_REENTRY)) /* 'ci' still the called one */ |
1113 | return; /* external invocation: return */ | 1112 | return; /* external invocation: return */ |
1114 | else { /* invocation via reentry: continue execution */ | 1113 | else { /* invocation via reentry: continue execution */ |