Skip to content

Commit cfb02d4

Browse files
TobiHartmannslowhog
authored andcommitted
8250861: Crash in MinINode::Ideal(PhaseGVN*, bool)
Added missing NULL checks. Reviewed-by: kvn, chagedorn
1 parent 0d35235 commit cfb02d4

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/hotspot/share/opto/addnode.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1078,15 +1078,15 @@ Node *MinINode::Ideal(PhaseGVN *phase, bool can_reshape) {
10781078

10791079
// Transform MIN2(x + c0, MIN2(x + c1, z)) into MIN2(x + MIN2(c0, c1), z)
10801080
// if x == y and the additions can't overflow.
1081-
if (phase->eqv(x,y) &&
1081+
if (phase->eqv(x,y) && tx != NULL &&
10821082
!can_overflow(tx, x_off) &&
10831083
!can_overflow(tx, y_off)) {
10841084
return new MinINode(phase->transform(new AddINode(x, phase->intcon(MIN2(x_off, y_off)))), r->in(2));
10851085
}
10861086
} else {
10871087
// Transform MIN2(x + c0, y + c1) into x + MIN2(c0, c1)
10881088
// if x == y and the additions can't overflow.
1089-
if (phase->eqv(x,y) &&
1089+
if (phase->eqv(x,y) && tx != NULL &&
10901090
!can_overflow(tx, x_off) &&
10911091
!can_overflow(tx, y_off)) {
10921092
return new AddINode(x,phase->intcon(MIN2(x_off,y_off)));

0 commit comments

Comments
 (0)