Actually implement maxirconst trace limit.

Suggested by spacewander.
This commit is contained in:
Mike Pall 2018-10-14 15:21:37 +02:00
parent 9c1b637898
commit 0a9ff94c4a

View File

@ -2470,8 +2470,9 @@ void lj_record_ins(jit_State *J)
#undef rbv #undef rbv
#undef rcv #undef rcv
/* Limit the number of recorded IR instructions. */ /* Limit the number of recorded IR instructions and constants. */
if (J->cur.nins > REF_FIRST+(IRRef)J->param[JIT_P_maxrecord]) if (J->cur.nins > REF_FIRST+(IRRef)J->param[JIT_P_maxrecord] ||
J->cur.nk < REF_BIAS-(IRRef)J->param[JIT_P_maxirconst])
lj_trace_err(J, LJ_TRERR_TRACEOV); lj_trace_err(J, LJ_TRERR_TRACEOV);
} }