java-11-openjdk/jdk8250861-crash_in_MinINode_Ideal.patch

33 lines
1.2 KiB
Diff
Raw Normal View History

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