mirror of https://github.com/rusefi/lua.git
Bug fix: Errors in finalizers need a valid 'pc'
Errors in finalizers need a valid 'pc' to produce an error message, even if the error is not propagated. Therefore, calls to the GC (which may call finalizers) inside luaV_execute must save the 'pc'.
This commit is contained in:
parent
b202669d76
commit
e37b96db04
5
lvm.c
5
lvm.c
|
@ -1104,7 +1104,7 @@ void luaV_finishOp (lua_State *L) {
|
||||||
|
|
||||||
|
|
||||||
#define checkGC(L,c) \
|
#define checkGC(L,c) \
|
||||||
{ luaC_condGC(L, L->top = (c), /* limit of live values */ \
|
{ luaC_condGC(L, (savepc(L), L->top = (c)), \
|
||||||
updatetrap(ci)); \
|
updatetrap(ci)); \
|
||||||
luai_threadyield(L); }
|
luai_threadyield(L); }
|
||||||
|
|
||||||
|
@ -1792,8 +1792,7 @@ void luaV_execute (lua_State *L, CallInfo *ci) {
|
||||||
vmbreak;
|
vmbreak;
|
||||||
}
|
}
|
||||||
vmcase(OP_VARARGPREP) {
|
vmcase(OP_VARARGPREP) {
|
||||||
luaT_adjustvarargs(L, GETARG_A(i), ci, cl->p);
|
ProtectNT(luaT_adjustvarargs(L, GETARG_A(i), ci, cl->p));
|
||||||
updatetrap(ci);
|
|
||||||
if (trap) {
|
if (trap) {
|
||||||
luaD_hookcall(L, ci);
|
luaD_hookcall(L, ci);
|
||||||
L->oldpc = pc + 1; /* next opcode will be seen as a "new" line */
|
L->oldpc = pc + 1; /* next opcode will be seen as a "new" line */
|
||||||
|
|
Loading…
Reference in New Issue