changeset 21758:532f9b06f54e

Another fix for the implicit null check phase.
author Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
date Fri, 05 Jun 2015 23:53:43 +0200
parents f60f7994c5a5
children 75daca0c6a0f
files graal/com.oracle.graal.phases.common/src/com/oracle/graal/phases/common/GuardLoweringPhase.java
diffstat 1 files changed, 6 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/graal/com.oracle.graal.phases.common/src/com/oracle/graal/phases/common/GuardLoweringPhase.java	Fri Jun 05 17:12:08 2015 +0200
+++ b/graal/com.oracle.graal.phases.common/src/com/oracle/graal/phases/common/GuardLoweringPhase.java	Fri Jun 05 23:53:43 2015 +0200
@@ -117,11 +117,12 @@
         private void check(Access access, ValueNode object) {
             ValueNode guard = nullGuarded.get(object);
             if (guard != null && isImplicitNullCheck(access.accessLocation())) {
-                if (object instanceof PiNode) {
-                    PiNode piNode = (PiNode) object;
-                    assert piNode.getGuard() instanceof GuardNode;
-                    assert access.object() == object;
-                    access.asNode().replaceFirstInput(object, piNode.getOriginalNode());
+                if (guard instanceof PiNode) {
+                    PiNode piNode = (PiNode) guard;
+                    assert guard == object;
+                    assert piNode.getGuard() instanceof GuardNode : piNode;
+                    assert access.object() == guard;
+                    access.asNode().replaceFirstInput(piNode, piNode.getOriginalNode());
                 } else {
                     assert guard instanceof GuardNode;
                 }