mirror of
https://github.com/LuaJIT/LuaJIT.git
synced 2025-02-07 23:24:09 +00:00
Throw any errors before stack changes in trace stitching.
Thanks to doujiang24.
This commit is contained in:
parent
c1c4c5599c
commit
3f9389edc6
@ -107,6 +107,10 @@ static void recff_stitch(jit_State *J)
|
|||||||
const BCIns *pc = frame_pc(base-1);
|
const BCIns *pc = frame_pc(base-1);
|
||||||
TValue *pframe = frame_prevl(base-1);
|
TValue *pframe = frame_prevl(base-1);
|
||||||
|
|
||||||
|
/* Check for this now. Throwing in lj_record_stop messes up the stack. */
|
||||||
|
if (J->cur.nsnap >= (MSize)J->param[JIT_P_maxsnap])
|
||||||
|
lj_trace_err(J, LJ_TRERR_SNAPOV);
|
||||||
|
|
||||||
/* Move func + args up in Lua stack and insert continuation. */
|
/* Move func + args up in Lua stack and insert continuation. */
|
||||||
memmove(&base[1], &base[-1-LJ_FR2], sizeof(TValue)*nslot);
|
memmove(&base[1], &base[-1-LJ_FR2], sizeof(TValue)*nslot);
|
||||||
setframe_ftsz(nframe, ((char *)nframe - (char *)pframe) + FRAME_CONT);
|
setframe_ftsz(nframe, ((char *)nframe - (char *)pframe) + FRAME_CONT);
|
||||||
|
Loading…
Reference in New Issue
Block a user