changeset 6792:77288aadc5a7 icedtea-2.6.24 icedtea-2.6.25pre00

8250861, PR3812: Crash in MinINode::Ideal(PhaseGVN*, bool) Summary: Added missing NULL checks. Reviewed-by: kvn, chagedorn
author thartmann
date Thu, 06 Aug 2020 08:10:56 +0200
parents a4c6e7e7efc5
children 4e25e809effc
files src/share/vm/opto/addnode.cpp
diffstat 1 files changed, 2 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/src/share/vm/opto/addnode.cpp	Mon Nov 02 02:26:23 2020 +0000
+++ b/src/share/vm/opto/addnode.cpp	Thu Aug 06 08:10:56 2020 +0200
@@ -918,7 +918,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 (phase->C) MinINode(phase->transform(new (phase->C) AddINode(x, phase->intcon(MIN2(x_off, y_off)))), r->in(2));
@@ -926,7 +926,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 (phase->C) AddINode(x,phase->intcon(MIN2(x_off,y_off)));