diff options
author | Mike Pall <mike> | 2024-08-15 00:17:19 +0200 |
---|---|---|
committer | Mike Pall <mike> | 2024-08-15 00:17:19 +0200 |
commit | 86e7123bb1782a5f200ba5e83b8c4f3fbad4f7bc (patch) | |
tree | 888c82fdb96028b92ec4f49c6f6efdab0895ccf3 /src/lj_snap.c | |
parent | 7369eff67d46d7f5fac9ee064e3fbf97a15458de (diff) | |
download | luajit-86e7123bb1782a5f200ba5e83b8c4f3fbad4f7bc.tar.gz luajit-86e7123bb1782a5f200ba5e83b8c4f3fbad4f7bc.tar.bz2 luajit-86e7123bb1782a5f200ba5e83b8c4f3fbad4f7bc.zip |
Different fix for partial snapshot restore due to stack overflow.
Reported by Junlong Li. Fixed by Peter Cawley. #1196
Diffstat (limited to 'src/lj_snap.c')
-rw-r--r-- | src/lj_snap.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/lj_snap.c b/src/lj_snap.c index 9858c110..0c317b52 100644 --- a/src/lj_snap.c +++ b/src/lj_snap.c | |||
@@ -873,7 +873,8 @@ const BCIns *lj_snap_restore(jit_State *J, void *exptr) | |||
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(cframe_raw(L->cframe), pc+1); | 876 | setcframe_pc(L->cframe, pc+1); |
877 | setcframe_pc(cframe_raw(cframe_prev(L->cframe)), pc); | ||
877 | 878 | ||
878 | /* Make sure the stack is big enough for the slots from the snapshot. */ | 879 | /* Make sure the stack is big enough for the slots from the snapshot. */ |
879 | if (LJ_UNLIKELY(L->base + snap->topslot >= tvref(L->maxstack))) { | 880 | if (LJ_UNLIKELY(L->base + snap->topslot >= tvref(L->maxstack))) { |