aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMike Pall <mike>2025-07-24 15:35:56 +0200
committerMike Pall <mike>2025-07-24 15:35:56 +0200
commite3fa3c48d8a4aadcf86429e9f7f6f1171914b15a (patch)
tree4b1f10a85dbbb034a353223d60e1a9024ee0566b /src
parentc64020f3c6d124503213147f2fb47c20335a395b (diff)
downloadluajit-e3fa3c48d8a4aadcf86429e9f7f6f1171914b15a.tar.gz
luajit-e3fa3c48d8a4aadcf86429e9f7f6f1171914b15a.tar.bz2
luajit-e3fa3c48d8a4aadcf86429e9f7f6f1171914b15a.zip
Avoid out-of-range PC for stack overflow error from snapshot restore.
Reported by Sergey Kaplun. #1369
Diffstat (limited to 'src')
-rw-r--r--src/lj_debug.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/lj_debug.c b/src/lj_debug.c
index a639cddf..f3409649 100644
--- a/src/lj_debug.c
+++ b/src/lj_debug.c
@@ -101,6 +101,7 @@ static BCPos debug_framepc(lua_State *L, GCfunc *fn, cTValue *nextframe)
101 pt = funcproto(fn); 101 pt = funcproto(fn);
102 pos = proto_bcpos(pt, ins) - 1; 102 pos = proto_bcpos(pt, ins) - 1;
103#if LJ_HASJIT 103#if LJ_HASJIT
104 if (pos == NO_BCPOS) return 1; /* Pretend it's the first bytecode. */
104 if (pos > pt->sizebc) { /* Undo the effects of lj_trace_exit for JLOOP. */ 105 if (pos > pt->sizebc) { /* Undo the effects of lj_trace_exit for JLOOP. */
105 if (bc_isret(bc_op(ins[-1]))) { 106 if (bc_isret(bc_op(ins[-1]))) {
106 GCtrace *T = (GCtrace *)((char *)(ins-1) - offsetof(GCtrace, startins)); 107 GCtrace *T = (GCtrace *)((char *)(ins-1) - offsetof(GCtrace, startins));