summaryrefslogtreecommitdiff
path: root/src/lj_snap.c
diff options
context:
space:
mode:
authorMike Pall <mike>2010-02-19 03:13:48 +0100
committerMike Pall <mike>2010-02-19 03:13:48 +0100
commitc52da1f2da4963762e7743419d58e372e1c9ac06 (patch)
tree17c5d88b4c36c9b369ef9ad1dcd913431e019136 /src/lj_snap.c
parentbbe7d818d9d9d47c48f255104166a58e7f65d3ec (diff)
downloadluajit-c52da1f2da4963762e7743419d58e372e1c9ac06.tar.gz
luajit-c52da1f2da4963762e7743419d58e372e1c9ac06.tar.bz2
luajit-c52da1f2da4963762e7743419d58e372e1c9ac06.zip
Rethrow errors from trace exit handling from the right C frame.
Diffstat (limited to 'src/lj_snap.c')
-rw-r--r--src/lj_snap.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/lj_snap.c b/src/lj_snap.c
index e17b7a0d..1353e90f 100644
--- a/src/lj_snap.c
+++ b/src/lj_snap.c
@@ -216,8 +216,12 @@ const BCIns *lj_snap_restore(jit_State *J, void *exptr)
216 BCReg nslots = snap->nslots; 216 BCReg nslots = snap->nslots;
217 TValue *frame; 217 TValue *frame;
218 BloomFilter rfilt = snap_renamefilter(T, snapno); 218 BloomFilter rfilt = snap_renamefilter(T, snapno);
219 const BCIns *pc = snap_pc(map[nent]);
219 lua_State *L = J->L; 220 lua_State *L = J->L;
220 221
222 /* Set interpreter PC to the next PC to get correct error messages. */
223 setcframe_pc(cframe_raw(L->cframe), pc+1);
224
221 /* Make sure the stack is big enough for the slots from the snapshot. */ 225 /* Make sure the stack is big enough for the slots from the snapshot. */
222 if (LJ_UNLIKELY(L->base + nslots > L->maxstack)) { 226 if (LJ_UNLIKELY(L->base + nslots > L->maxstack)) {
223 L->top = curr_topL(L); 227 L->top = curr_topL(L);
@@ -289,7 +293,7 @@ const BCIns *lj_snap_restore(jit_State *J, void *exptr)
289 } 293 }
290 L->top = curr_topL(L); 294 L->top = curr_topL(L);
291 lua_assert(map + nent == flinks); 295 lua_assert(map + nent == flinks);
292 return snap_pc(*flinks); 296 return pc;
293} 297}
294 298
295#undef IR 299#undef IR