diff options
Diffstat (limited to 'lvm.c')
-rw-r--r-- | lvm.c | 6 |
1 files changed, 3 insertions, 3 deletions
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | ** $Id: lvm.c,v 2.256 2015/10/22 14:40:47 roberto Exp roberto $ | 2 | ** $Id: lvm.c,v 2.257 2015/10/28 14:50:09 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 | */ |
@@ -764,6 +764,7 @@ void luaV_execute (lua_State *L) { | |||
764 | LClosure *cl; | 764 | LClosure *cl; |
765 | TValue *k; | 765 | TValue *k; |
766 | StkId base; | 766 | StkId base; |
767 | ci->callstatus |= CIST_FRESH; /* fresh invocation of 'luaV_execute" */ | ||
767 | newframe: /* reentry point when frame changes (call/return) */ | 768 | newframe: /* reentry point when frame changes (call/return) */ |
768 | lua_assert(ci == L->ci); | 769 | lua_assert(ci == L->ci); |
769 | cl = clLvalue(ci->func); /* local reference to function's closure */ | 770 | cl = clLvalue(ci->func); /* local reference to function's closure */ |
@@ -1118,7 +1119,6 @@ void luaV_execute (lua_State *L) { | |||
1118 | } | 1119 | } |
1119 | else { /* Lua function */ | 1120 | else { /* Lua function */ |
1120 | ci = L->ci; | 1121 | ci = L->ci; |
1121 | ci->callstatus |= CIST_REENTRY; | ||
1122 | goto newframe; /* restart luaV_execute over new Lua function */ | 1122 | goto newframe; /* restart luaV_execute over new Lua function */ |
1123 | } | 1123 | } |
1124 | vmbreak; | 1124 | vmbreak; |
@@ -1158,7 +1158,7 @@ void luaV_execute (lua_State *L) { | |||
1158 | int b = GETARG_B(i); | 1158 | int b = GETARG_B(i); |
1159 | if (cl->p->sizep > 0) luaF_close(L, base); | 1159 | if (cl->p->sizep > 0) luaF_close(L, base); |
1160 | b = luaD_poscall(L, ra, (b != 0 ? b - 1 : cast_int(L->top - ra))); | 1160 | b = luaD_poscall(L, ra, (b != 0 ? b - 1 : cast_int(L->top - ra))); |
1161 | if (!(ci->callstatus & CIST_REENTRY)) /* 'ci' still the called one */ | 1161 | if (ci->callstatus & CIST_FRESH) /* local 'ci' still from callee */ |
1162 | return; /* external invocation: return */ | 1162 | return; /* external invocation: return */ |
1163 | else { /* invocation via reentry: continue execution */ | 1163 | else { /* invocation via reentry: continue execution */ |
1164 | ci = L->ci; | 1164 | ci = L->ci; |