mirror of
https://github.com/LuaJIT/LuaJIT.git
synced 2025-02-07 23:24:09 +00:00
Avoid assertion in case of stack overflow from stitched trace.
Reported by Sergey Bronnikov. Fixed by Sergey Kaplun.
This commit is contained in:
parent
46aa45dcbd
commit
1d75cd4d7b
@ -101,9 +101,12 @@ static BCPos debug_framepc(lua_State *L, GCfunc *fn, cTValue *nextframe)
|
|||||||
pos = proto_bcpos(pt, ins) - 1;
|
pos = proto_bcpos(pt, ins) - 1;
|
||||||
#if LJ_HASJIT
|
#if LJ_HASJIT
|
||||||
if (pos > pt->sizebc) { /* Undo the effects of lj_trace_exit for JLOOP. */
|
if (pos > pt->sizebc) { /* Undo the effects of lj_trace_exit for JLOOP. */
|
||||||
GCtrace *T = (GCtrace *)((char *)(ins-1) - offsetof(GCtrace, startins));
|
if (bc_isret(bc_op(ins[-1]))) {
|
||||||
lj_assertL(bc_isret(bc_op(ins[-1])), "return bytecode expected");
|
GCtrace *T = (GCtrace *)((char *)(ins-1) - offsetof(GCtrace, startins));
|
||||||
pos = proto_bcpos(pt, mref(T->startpc, const BCIns));
|
pos = proto_bcpos(pt, mref(T->startpc, const BCIns));
|
||||||
|
} else {
|
||||||
|
pos = NO_BCPOS; /* Punt in case of stack overflow for stitched trace. */
|
||||||
|
}
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
return pos;
|
return pos;
|
||||||
|
Loading…
Reference in New Issue
Block a user