diff options
| -rw-r--r-- | lvm.c | 15 |
1 files changed, 10 insertions, 5 deletions
| @@ -1,5 +1,5 @@ | |||
| 1 | /* | 1 | /* |
| 2 | ** $Id: lvm.c,v 2.332 2018/01/09 14:23:40 roberto Exp roberto $ | 2 | ** $Id: lvm.c,v 2.333 2018/01/10 19:19:27 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 | */ |
| @@ -1504,13 +1504,18 @@ void luaV_execute (lua_State *L, CallInfo *ci) { | |||
| 1504 | ProtectNT(luaD_tryfuncTM(L, ra)); /* try '__call' metamethod */ | 1504 | ProtectNT(luaD_tryfuncTM(L, ra)); /* try '__call' metamethod */ |
| 1505 | b++; /* there is now one extra argument */ | 1505 | b++; /* there is now one extra argument */ |
| 1506 | } | 1506 | } |
| 1507 | if (TESTARG_k(i)) | ||
| 1508 | luaF_close(L, base); /* close upvalues from current call */ | ||
| 1507 | if (!ttisLclosure(vra)) { /* C function? */ | 1509 | if (!ttisLclosure(vra)) { /* C function? */ |
| 1508 | ProtectNT(luaD_call(L, ra, LUA_MULTRET)); /* call it */ | 1510 | ProtectNT(luaD_call(L, ra, LUA_MULTRET)); /* call it */ |
| 1509 | /* next instruction will do the return */ | 1511 | if (trap) { |
| 1512 | updatebase(ci); | ||
| 1513 | ra = RA(i); | ||
| 1514 | } | ||
| 1515 | luaD_poscall(L, ci, ra, cast_int(L->top - ra)); | ||
| 1516 | return; | ||
| 1510 | } | 1517 | } |
| 1511 | else { /* tail call */ | 1518 | else { /* Lua tail call */ |
| 1512 | if (TESTARG_k(i)) /* close upvalues from previous call */ | ||
| 1513 | luaF_close(L, ci->func + 1); | ||
| 1514 | luaD_pretailcall(L, ci, ra, b); /* prepare call frame */ | 1519 | luaD_pretailcall(L, ci, ra, b); /* prepare call frame */ |
| 1515 | goto tailcall; | 1520 | goto tailcall; |
| 1516 | } | 1521 | } |
