Blame SOURCES/jdk8250861-rh1895274-crash_in_MinINode_Ideal.patch

0f3be5
0f3be5
# HG changeset patch
0f3be5
# User thartmann
0f3be5
# Date 1604482955 -3600
0f3be5
# Node ID 27723943c0dd65a191cbefe031cec001521e4b13
0f3be5
# Parent  e9d90c9daf895b469b461b727b6887e7780b4ac2
0f3be5
8250861: Crash in MinINode::Ideal(PhaseGVN*, bool)
0f3be5
Summary: Added missing NULL checks.
0f3be5
Reviewed-by: kvn, chagedorn
0f3be5
0f3be5
diff -r e9d90c9daf89 -r 27723943c0dd src/hotspot/share/opto/addnode.cpp
0f3be5
--- a/src/hotspot/share/opto/addnode.cpp	Mon Nov 02 20:20:05 2020 +0100
0f3be5
+++ b/src/hotspot/share/opto/addnode.cpp	Wed Nov 04 10:42:35 2020 +0100
0f3be5
@@ -917,7 +917,7 @@
0f3be5
 
0f3be5
     // Transform MIN2(x + c0, MIN2(x + c1, z)) into MIN2(x + MIN2(c0, c1), z)
0f3be5
     // if x == y and the additions can't overflow.
0f3be5
-    if (phase->eqv(x,y) &&
0f3be5
+    if (phase->eqv(x,y) && tx != NULL &&
0f3be5
         !can_overflow(tx, x_off) &&
0f3be5
         !can_overflow(tx, y_off)) {
0f3be5
       return new MinINode(phase->transform(new AddINode(x, phase->intcon(MIN2(x_off, y_off)))), r->in(2));
0f3be5
@@ -925,7 +925,7 @@
0f3be5
   } else {
0f3be5
     // Transform MIN2(x + c0, y + c1) into x + MIN2(c0, c1)
0f3be5
     // if x == y and the additions can't overflow.
0f3be5
-    if (phase->eqv(x,y) &&
0f3be5
+    if (phase->eqv(x,y) && tx != NULL &&
0f3be5
         !can_overflow(tx, x_off) &&
0f3be5
         !can_overflow(tx, y_off)) {
0f3be5
       return new AddINode(x,phase->intcon(MIN2(x_off,y_off)));
0f3be5