diff options
Diffstat (limited to 'src/lj_snap.c')
-rw-r--r-- | src/lj_snap.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/lj_snap.c b/src/lj_snap.c index 82ab6983..54260021 100644 --- a/src/lj_snap.c +++ b/src/lj_snap.c | |||
@@ -872,8 +872,10 @@ const BCIns *lj_snap_restore(jit_State *J, void *exptr) | |||
872 | const BCIns *pc = snap_pc(map[nent]); | 872 | const BCIns *pc = snap_pc(map[nent]); |
873 | lua_State *L = J->L; | 873 | lua_State *L = J->L; |
874 | 874 | ||
875 | /* Set interpreter PC to the next PC to get correct error messages. */ | 875 | /* Set interpreter PC to the next PC to get correct error messages. |
876 | setcframe_pc(L->cframe, pc+1); | 876 | ** But not for returns or tail calls, since pc+1 may be out-of-range. |
877 | */ | ||
878 | setcframe_pc(L->cframe, bc_isret_or_tail(bc_op(*pc)) ? pc : pc+1); | ||
877 | setcframe_pc(cframe_raw(cframe_prev(L->cframe)), pc); | 879 | setcframe_pc(cframe_raw(cframe_prev(L->cframe)), pc); |
878 | 880 | ||
879 | /* Make sure the stack is big enough for the slots from the snapshot. */ | 881 | /* Make sure the stack is big enough for the slots from the snapshot. */ |