diff options
Diffstat (limited to '')
-rw-r--r-- | src/lj_record.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/lj_record.c b/src/lj_record.c index 6666b3c6..3ba2ce8b 100644 --- a/src/lj_record.c +++ b/src/lj_record.c | |||
@@ -1395,12 +1395,13 @@ static void rec_idx_abc(jit_State *J, TRef asizeref, TRef ikey, uint32_t asize) | |||
1395 | /* Runtime value for stop of loop is within bounds? */ | 1395 | /* Runtime value for stop of loop is within bounds? */ |
1396 | if ((uint64_t)stop + ofs < (uint64_t)asize) { | 1396 | if ((uint64_t)stop + ofs < (uint64_t)asize) { |
1397 | /* Emit invariant bounds check for stop. */ | 1397 | /* Emit invariant bounds check for stop. */ |
1398 | emitir(IRTG(IR_ABC, IRT_P32), asizeref, ofs == 0 ? J->scev.stop : | 1398 | uint32_t abc = IRTG(IR_ABC, tref_isk(asizeref) ? IRT_U32 : IRT_P32); |
1399 | emitir(abc, asizeref, ofs == 0 ? J->scev.stop : | ||
1399 | emitir(IRTI(IR_ADD), J->scev.stop, ofsref)); | 1400 | emitir(IRTI(IR_ADD), J->scev.stop, ofsref)); |
1400 | /* Emit invariant bounds check for start, if not const or negative. */ | 1401 | /* Emit invariant bounds check for start, if not const or negative. */ |
1401 | if (!(J->scev.dir && J->scev.start && | 1402 | if (!(J->scev.dir && J->scev.start && |
1402 | (int64_t)IR(J->scev.start)->i + ofs >= 0)) | 1403 | (int64_t)IR(J->scev.start)->i + ofs >= 0)) |
1403 | emitir(IRTG(IR_ABC, IRT_P32), asizeref, ikey); | 1404 | emitir(abc, asizeref, ikey); |
1404 | return; | 1405 | return; |
1405 | } | 1406 | } |
1406 | } | 1407 | } |