Blame SOURCES/0019-Fix-FOLD-rule-for-strength-reduction-of-widening.patch

006bc1
From 9f0caad0e43f97a4613850b3874b851cb1bc301d Mon Sep 17 00:00:00 2001
006bc1
From: Mike Pall <mike>
006bc1
Date: Wed, 8 Nov 2017 12:53:05 +0100
006bc1
Subject: [PATCH 19/72] Fix FOLD rule for strength reduction of widening.
006bc1
006bc1
Reported by Matthew Burk.
006bc1
---
006bc1
 src/lj_opt_fold.c | 2 +-
006bc1
 1 file changed, 1 insertion(+), 1 deletion(-)
006bc1
006bc1
diff --git a/src/lj_opt_fold.c b/src/lj_opt_fold.c
006bc1
index 3d0e35a..5dc7ae3 100644
006bc1
--- a/src/lj_opt_fold.c
006bc1
+++ b/src/lj_opt_fold.c
006bc1
@@ -1052,7 +1052,7 @@ LJFOLDF(simplify_conv_sext)
006bc1
   if (ref == J->scev.idx) {
006bc1
     IRRef lo = J->scev.dir ? J->scev.start : J->scev.stop;
006bc1
     lua_assert(irt_isint(J->scev.t));
006bc1
-    if (lo && IR(lo)->i + ofs >= 0) {
006bc1
+    if (lo && IR(lo)->o == IR_KINT && IR(lo)->i + ofs >= 0) {
006bc1
     ok_reduce:
006bc1
 #if LJ_TARGET_X64
006bc1
       /* Eliminate widening. All 32 bit ops do an implicit zero-extension. */
006bc1
-- 
006bc1
2.20.1
006bc1