Browse Source

Fix FOLD rule for strength reduction of widening.

Reported by Matthew Burk.
Mike Pall 7 years ago
parent
commit
9f0caad0e4
1 changed files with 1 additions and 1 deletions
  1. 1 1
      src/lj_opt_fold.c

+ 1 - 1
src/lj_opt_fold.c

@@ -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. */