diff options
author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2008-09-09 10:53:02 -0300 |
---|---|---|
committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2008-09-09 10:53:02 -0300 |
commit | 4376c9bc5fb03b432f266db33041438e75440f31 (patch) | |
tree | d962116130cbdb40096f59e16a69355d84462bfa /lvm.c | |
parent | f94cd2201c3a8d341db448f2719dfb0ae4338adf (diff) | |
download | lua-4376c9bc5fb03b432f266db33041438e75440f31.tar.gz lua-4376c9bc5fb03b432f266db33041438e75440f31.tar.bz2 lua-4376c9bc5fb03b432f266db33041438e75440f31.zip |
more specific test to avoid calling luaF_close when function returns
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.75 2008/08/13 17:02:42 roberto Exp roberto $ | 2 | ** $Id: lvm.c,v 2.76 2008/08/26 13:27:42 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 | */ |
@@ -622,7 +622,7 @@ void luaV_execute (lua_State *L) { | |||
622 | int aux; | 622 | int aux; |
623 | StkId func = ci->func; | 623 | StkId func = ci->func; |
624 | StkId pfunc = (ci+1)->func; /* previous function index */ | 624 | StkId pfunc = (ci+1)->func; /* previous function index */ |
625 | if (L->openupval) luaF_close(L, ci->base); | 625 | if (cl->p->sizep > 0) luaF_close(L, ci->base); |
626 | L->base = ci->base = ci->func + ((ci+1)->base - pfunc); | 626 | L->base = ci->base = ci->func + ((ci+1)->base - pfunc); |
627 | for (aux = 0; pfunc+aux < L->top; aux++) /* move frame down */ | 627 | for (aux = 0; pfunc+aux < L->top; aux++) /* move frame down */ |
628 | setobjs2s(L, func+aux, pfunc+aux); | 628 | setobjs2s(L, func+aux, pfunc+aux); |
@@ -637,7 +637,7 @@ void luaV_execute (lua_State *L) { | |||
637 | case OP_RETURN: { | 637 | case OP_RETURN: { |
638 | int b = GETARG_B(i); | 638 | int b = GETARG_B(i); |
639 | if (b != 0) L->top = ra+b-1; | 639 | if (b != 0) L->top = ra+b-1; |
640 | if (L->openupval) luaF_close(L, base); | 640 | if (cl->p->sizep > 0) luaF_close(L, base); |
641 | b = luaD_poscall(L, ra); | 641 | b = luaD_poscall(L, ra); |
642 | if (!((L->ci + 1)->callstatus & CIST_REENTRY)) | 642 | if (!((L->ci + 1)->callstatus & CIST_REENTRY)) |
643 | return; /* external invocation: return */ | 643 | return; /* external invocation: return */ |