diff options
Diffstat (limited to 'lvm.c')
-rw-r--r-- | lvm.c | 10 |
1 files changed, 6 insertions, 4 deletions
@@ -1556,20 +1556,22 @@ void luaV_execute (lua_State *L, CallInfo *ci) { | |||
1556 | L->top = ra + b; | 1556 | L->top = ra + b; |
1557 | else /* previous instruction set top */ | 1557 | else /* previous instruction set top */ |
1558 | b = cast_int(L->top - ra); | 1558 | b = cast_int(L->top - ra); |
1559 | savepc(ci); /* some calls here can raise errors */ | ||
1559 | if (TESTARG_k(i)) { | 1560 | if (TESTARG_k(i)) { |
1560 | int nparams1 = GETARG_C(i); | 1561 | int nparams1 = GETARG_C(i); |
1561 | if (nparams1) /* vararg function? */ | 1562 | if (nparams1) /* vararg function? */ |
1562 | delta = ci->u.l.nextraargs + nparams1; | 1563 | delta = ci->u.l.nextraargs + nparams1; |
1563 | /* close upvalues from current call */ | 1564 | /* close upvalues from current call; the compiler ensures |
1564 | luaF_close(L, base, LUA_OK); | 1565 | that there are no to-be-closed variables here */ |
1565 | updatestack(ci); | 1566 | luaF_close(L, base, NOCLOSINGMETH); |
1566 | } | 1567 | } |
1567 | if (!ttisfunction(s2v(ra))) { /* not a function? */ | 1568 | if (!ttisfunction(s2v(ra))) { /* not a function? */ |
1568 | luaD_tryfuncTM(L, ra); /* try '__call' metamethod */ | 1569 | luaD_tryfuncTM(L, ra); /* try '__call' metamethod */ |
1569 | b++; /* there is now one extra argument */ | 1570 | b++; /* there is now one extra argument */ |
1570 | } | 1571 | } |
1571 | if (!ttisLclosure(s2v(ra))) { /* C function? */ | 1572 | if (!ttisLclosure(s2v(ra))) { /* C function? */ |
1572 | ProtectNT(luaD_call(L, ra, LUA_MULTRET)); /* call it */ | 1573 | luaD_call(L, ra, LUA_MULTRET); /* call it */ |
1574 | updatetrap(ci); | ||
1573 | updatestack(ci); /* stack may have been relocated */ | 1575 | updatestack(ci); /* stack may have been relocated */ |
1574 | ci->func -= delta; | 1576 | ci->func -= delta; |
1575 | luaD_poscall(L, ci, cast_int(L->top - ra)); | 1577 | luaD_poscall(L, ci, cast_int(L->top - ra)); |