aboutsummaryrefslogtreecommitdiff
path: root/src/lj_record.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/lj_record.c')
-rw-r--r--src/lj_record.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/lj_record.c b/src/lj_record.c
index f2a06f41..207327b3 100644
--- a/src/lj_record.c
+++ b/src/lj_record.c
@@ -1069,12 +1069,13 @@ static void rec_idx_abc(jit_State *J, TRef asizeref, TRef ikey, uint32_t asize)
1069 /* Runtime value for stop of loop is within bounds? */ 1069 /* Runtime value for stop of loop is within bounds? */
1070 if ((uint64_t)stop + ofs < (uint64_t)asize) { 1070 if ((uint64_t)stop + ofs < (uint64_t)asize) {
1071 /* Emit invariant bounds check for stop. */ 1071 /* Emit invariant bounds check for stop. */
1072 emitir(IRTG(IR_ABC, IRT_P32), asizeref, ofs == 0 ? J->scev.stop : 1072 uint32_t abc = IRTG(IR_ABC, tref_isk(asizeref) ? IRT_U32 : IRT_P32);
1073 emitir(abc, asizeref, ofs == 0 ? J->scev.stop :
1073 emitir(IRTI(IR_ADD), J->scev.stop, ofsref)); 1074 emitir(IRTI(IR_ADD), J->scev.stop, ofsref));
1074 /* Emit invariant bounds check for start, if not const or negative. */ 1075 /* Emit invariant bounds check for start, if not const or negative. */
1075 if (!(J->scev.dir && J->scev.start && 1076 if (!(J->scev.dir && J->scev.start &&
1076 (int64_t)IR(J->scev.start)->i + ofs >= 0)) 1077 (int64_t)IR(J->scev.start)->i + ofs >= 0))
1077 emitir(IRTG(IR_ABC, IRT_P32), asizeref, ikey); 1078 emitir(abc, asizeref, ikey);
1078 return; 1079 return;
1079 } 1080 }
1080 } 1081 }