diff --git a/src/lj_trace.c b/src/lj_trace.c index a5e316e1..f384cbdb 100644 --- a/src/lj_trace.c +++ b/src/lj_trace.c @@ -905,8 +905,10 @@ int LJ_FASTCALL lj_trace_exit(jit_State *J, void *exptr) exd.J = J; exd.exptr = exptr; errcode = lj_vm_cpcall(L, NULL, &exd, trace_exit_cp); - if (errcode) + if (errcode) { + setcframe_pc(cframe_raw(L->cframe), L); /* Point to any valid memory. */ return -errcode; /* Return negated error code. */ + } if (exitcode) copyTV(L, L->top++, &exiterr); /* Anchor the error object. */