Skip to content

Commit

Permalink
Fix FOLD rule for strength reduction of widening.
Browse files Browse the repository at this point in the history
Reported by Matthew Burk.
  • Loading branch information
Mike Pall committed Nov 8, 2017
1 parent 0c0e7b1 commit 9f0caad
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/lj_opt_fold.c
Original file line number Diff line number Diff line change
Expand Up @@ -1052,7 +1052,7 @@ LJFOLDF(simplify_conv_sext)
if (ref == J->scev.idx) {
IRRef lo = J->scev.dir ? J->scev.start : J->scev.stop;
lua_assert(irt_isint(J->scev.t));
if (lo && IR(lo)->i + ofs >= 0) {
if (lo && IR(lo)->o == IR_KINT && IR(lo)->i + ofs >= 0) {
ok_reduce:
#if LJ_TARGET_X64
/* Eliminate widening. All 32 bit ops do an implicit zero-extension. */
Expand Down

0 comments on commit 9f0caad

Please sign in to comment.