diff options
author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2005-04-11 15:01:29 -0300 |
---|---|---|
committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2005-04-11 15:01:29 -0300 |
commit | a7ea0c71e80fa9f5f433b5495108164e6131404e (patch) | |
tree | 2774a829e086fd6c909a5cdcb47072b4db8297d4 /lvm.c | |
parent | b1957b1e8eef6c7f9e121af63baff90e980c724d (diff) | |
download | lua-a7ea0c71e80fa9f5f433b5495108164e6131404e.tar.gz lua-a7ea0c71e80fa9f5f433b5495108164e6131404e.tar.bz2 lua-a7ea0c71e80fa9f5f433b5495108164e6131404e.zip |
detail
Diffstat (limited to 'lvm.c')
-rw-r--r-- | lvm.c | 9 |
1 files changed, 4 insertions, 5 deletions
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | ** $Id: lvm.c,v 2.36 2005/04/04 18:12:51 roberto Exp roberto $ | 2 | ** $Id: lvm.c,v 2.37 2005/04/05 13:41:29 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 | */ |
@@ -642,16 +642,15 @@ StkId luaV_execute (lua_State *L, int nexeccalls) { | |||
642 | } | 642 | } |
643 | } | 643 | } |
644 | case OP_RETURN: { | 644 | case OP_RETURN: { |
645 | CallInfo *ci = L->ci - 1; /* previous function frame */ | ||
646 | int b = GETARG_B(i); | 645 | int b = GETARG_B(i); |
647 | if (b != 0) L->top = ra+b-1; | 646 | if (b != 0) L->top = ra+b-1; |
648 | if (L->openupval) luaF_close(L, base); | 647 | if (L->openupval) luaF_close(L, base); |
649 | if (--nexeccalls == 0) /* was previous function running `here'? */ | 648 | if (--nexeccalls == 0) /* was previous function running `here'? */ |
650 | return ra; /* no: return */ | 649 | return ra; /* no: return */ |
651 | else { /* yes: continue its execution */ | 650 | else { /* yes: continue its execution */ |
652 | int nresults = (ci+1)->nresults; | 651 | int nresults = L->ci->nresults; |
653 | lua_assert(isLua(ci)); | 652 | lua_assert(isLua(L->ci - 1)); |
654 | lua_assert(GET_OPCODE(*(ci->savedpc - 1)) == OP_CALL); | 653 | lua_assert(GET_OPCODE(*((L->ci - 1)->savedpc - 1)) == OP_CALL); |
655 | luaD_poscall(L, nresults, ra); | 654 | luaD_poscall(L, nresults, ra); |
656 | if (nresults >= 0) L->top = L->ci->top; | 655 | if (nresults >= 0) L->top = L->ci->top; |
657 | goto retentry; | 656 | goto retentry; |