Skip to content

Commit 9f0caad

Browse files
author
Mike Pall
committed
Fix FOLD rule for strength reduction of widening.
Reported by Matthew Burk.
1 parent 0c0e7b1 commit 9f0caad

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/lj_opt_fold.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1052,7 +1052,7 @@ LJFOLDF(simplify_conv_sext)
10521052
if (ref == J->scev.idx) {
10531053
IRRef lo = J->scev.dir ? J->scev.start : J->scev.stop;
10541054
lua_assert(irt_isint(J->scev.t));
1055-
if (lo && IR(lo)->i + ofs >= 0) {
1055+
if (lo && IR(lo)->o == IR_KINT && IR(lo)->i + ofs >= 0) {
10561056
ok_reduce:
10571057
#if LJ_TARGET_X64
10581058
/* Eliminate widening. All 32 bit ops do an implicit zero-extension. */

0 commit comments

Comments
 (0)