diff graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/calc/CompareNode.java @ 19376:525d1e6067b7

Small fix for compare node. Returned node could already be in the graph.
author Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
date Sat, 14 Feb 2015 21:32:35 +0100
parents 03adf6499fee
children 7e2c87dae93e
line wrap: on
line diff
--- a/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/calc/CompareNode.java	Sat Feb 14 19:45:33 2015 +0100
+++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/calc/CompareNode.java	Sat Feb 14 21:32:35 2015 +0100
@@ -166,7 +166,8 @@
     }
 
     public static LogicNode createCompareNode(StructuredGraph graph, Condition condition, ValueNode x, ValueNode y, ConstantReflectionProvider constantReflection) {
-        return graph.unique(createCompareNode(condition, x, y, constantReflection));
+        LogicNode result = createCompareNode(condition, x, y, constantReflection);
+        return (result.graph() == null ? graph.unique(result) : result);
     }
 
     public static LogicNode createCompareNode(Condition condition, ValueNode x, ValueNode y, ConstantReflectionProvider constantReflection) {