Rethrow errors from trace exit handling from the right C frame.

This commit is contained in:
Mike Pall
2010-02-19 03:13:48 +01:00
parent bbe7d818d9
commit c52da1f2da
9 changed files with 1809 additions and 1769 deletions

View File

@@ -216,8 +216,12 @@ const BCIns *lj_snap_restore(jit_State *J, void *exptr)
BCReg nslots = snap->nslots;
TValue *frame;
BloomFilter rfilt = snap_renamefilter(T, snapno);
const BCIns *pc = snap_pc(map[nent]);
lua_State *L = J->L;
/* Set interpreter PC to the next PC to get correct error messages. */
setcframe_pc(cframe_raw(L->cframe), pc+1);
/* Make sure the stack is big enough for the slots from the snapshot. */
if (LJ_UNLIKELY(L->base + nslots > L->maxstack)) {
L->top = curr_topL(L);
@@ -289,7 +293,7 @@ const BCIns *lj_snap_restore(jit_State *J, void *exptr)
}
L->top = curr_topL(L);
lua_assert(map + nent == flinks);
return snap_pc(*flinks);
return pc;
}
#undef IR