Don't bail out to interpreter to JLOOP originating from ITERN.

Otherwise forward progress is not guaranteed.
Reported by Yichun Zhang.
This commit is contained in:
Mike Pall 2021-09-20 14:40:23 +02:00
parent 003f68565d
commit 28440544ba

View File

@ -2765,9 +2765,11 @@ void lj_record_setup(jit_State *J)
}
lj_snap_replay(J, T);
sidecheck:
if (traceref(J, J->cur.root)->nchild >= J->param[JIT_P_maxside] ||
T->snap[J->exitno].count >= J->param[JIT_P_hotexit] +
J->param[JIT_P_tryside]) {
if ((traceref(J, J->cur.root)->nchild >= J->param[JIT_P_maxside] ||
T->snap[J->exitno].count >= J->param[JIT_P_hotexit] +
J->param[JIT_P_tryside]) &&
!(bc_op(*J->pc) == BC_JLOOP &&
bc_op(traceref(J, bc_d(*J->pc))->startins) == BC_ITERN)) {
lj_record_stop(J, LJ_TRLINK_INTERP, 0);
}
} else { /* Root trace. */