|
@@ -437,7 +437,7 @@ static LoopEvent rec_for(jit_State *J, const BCIns *fori, int isforl)
|
|
|
IRType t;
|
|
|
if (isforl) { /* Handle FORL/JFORL opcodes. */
|
|
|
TRef idx = tr[FORL_IDX];
|
|
|
- if (mref(J->scev.pc, const BCIns) == fori) {
|
|
|
+ if (mref(J->scev.pc, const BCIns) == fori && tref_ref(idx) == J->scev.idx) {
|
|
|
t = J->scev.t.irt;
|
|
|
stop = J->scev.stop;
|
|
|
idx = emitir(IRT(IR_ADD, t), idx, J->scev.step);
|