summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--chapter16/src/main/java/com/seaofnodes/simple/node/ScopeNode.java1
-rw-r--r--chapter16/src/test/java/com/seaofnodes/simple/Chapter06Test.java6
2 files changed, 3 insertions, 4 deletions
diff --git a/chapter16/src/main/java/com/seaofnodes/simple/node/ScopeNode.java b/chapter16/src/main/java/com/seaofnodes/simple/node/ScopeNode.java
index 9f6ed6e3..11e54d82 100644
--- a/chapter16/src/main/java/com/seaofnodes/simple/node/ScopeNode.java
+++ b/chapter16/src/main/java/com/seaofnodes/simple/node/ScopeNode.java
@@ -268,7 +268,6 @@ public class ScopeNode extends ScopeMinNode {
// This Scope looks for direct variable uses, or certain simple
// combinations, and replaces the variable with the upcast variant.
public Node upcast( Node ctrl, Node pred, boolean invert ) {
- if( ctrl._type==Type.XCONTROL ) return null;
// Invert the If conditional
if( invert )
pred = pred instanceof NotNode not ? not.in(1) : IterPeeps.add(new NotNode(pred).peephole());
diff --git a/chapter16/src/test/java/com/seaofnodes/simple/Chapter06Test.java b/chapter16/src/test/java/com/seaofnodes/simple/Chapter06Test.java
index 6308bdea..ff1f3251 100644
--- a/chapter16/src/test/java/com/seaofnodes/simple/Chapter06Test.java
+++ b/chapter16/src/test/java/com/seaofnodes/simple/Chapter06Test.java
@@ -84,7 +84,7 @@ else
b=5;
return b;""", TypeInteger.BOT);
StopNode stop = parser.parse().iterate();
- assertEquals("return Phi(Region36,2,5);", stop.toString());
+ assertEquals("return Phi(Region38,2,5);", stop.toString());
}
@Test
@@ -200,7 +200,7 @@ if( arg ) {
return a+b;
""");
StopNode ret = parser.parse().iterate();
- assertEquals("return Phi(Region32,4,1);", ret.toString());
+ assertEquals("return Phi(Region35,4,1);", ret.toString());
}
@@ -251,7 +251,7 @@ if( arg ) {
return a+b+c;
""");
StopNode ret = parser.parse().iterate();
- assertEquals("return (Phi(Region45,Phi(Region29,2,3),0)+Phi(Region,3,1));", ret.toString());
+ assertEquals("return (Phi(Region48,Phi(Region29,2,3),0)+Phi(Region,3,1));", ret.toString());
}