Blame SOURCES/jdk8250861-rh1895274-crash_in_MinINode_Ideal.patch

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