summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--chapter33/src/main/java/com/seaofnodes/simple/node/FldOffNode.java2
-rw-r--r--chapter33/src/test/java/com/seaofnodes/simple/CallEndTest.java2
-rw-r--r--chapter33/src/test/java/com/seaofnodes/simple/Chapter23Test.java5
3 files changed, 5 insertions, 4 deletions
diff --git a/chapter33/src/main/java/com/seaofnodes/simple/node/FldOffNode.java b/chapter33/src/main/java/com/seaofnodes/simple/node/FldOffNode.java
index e49162f4..93f2baf9 100644
--- a/chapter33/src/main/java/com/seaofnodes/simple/node/FldOffNode.java
+++ b/chapter33/src/main/java/com/seaofnodes/simple/node/FldOffNode.java
@@ -31,7 +31,7 @@ public class FldOffNode extends TypeNode {
}
@Override public Type compute() {
- return Type.BOTTOM;
+ return TypeInteger.BOT;
}
@Override public Node idealize() {
diff --git a/chapter33/src/test/java/com/seaofnodes/simple/CallEndTest.java b/chapter33/src/test/java/com/seaofnodes/simple/CallEndTest.java
index 7983141d..26e479b2 100644
--- a/chapter33/src/test/java/com/seaofnodes/simple/CallEndTest.java
+++ b/chapter33/src/test/java/com/seaofnodes/simple/CallEndTest.java
@@ -78,7 +78,7 @@ public class CallEndTest {
// with its data parameter, not share it with the old body.
FldOffNode off = new FldOffNode(fun.parm(3),"<<",null).init();
fun.ret().setDef(2,off);
- assertSame(Type.BOTTOM,off._type);
+ assertSame(TypeInteger.BOT,off._type);
assertTrue("Unresolved field offset belongs to the function",fun.body().get(off._nid));
return;
}
diff --git a/chapter33/src/test/java/com/seaofnodes/simple/Chapter23Test.java b/chapter33/src/test/java/com/seaofnodes/simple/Chapter23Test.java
index 8667c0bd..8fb781f9 100644
--- a/chapter33/src/test/java/com/seaofnodes/simple/Chapter23Test.java
+++ b/chapter33/src/test/java/com/seaofnodes/simple/Chapter23Test.java
@@ -252,7 +252,7 @@ return (a && sq_noInline(0))
@Test
- public void testFRefFields() {
+ public void testFRefFields() throws IOException {
String src = """
// A hypothetical scanner class
struct _Scan {
@@ -279,7 +279,8 @@ return _s.peek('q');
CodeGen code = new CodeGen(src).driver(CodeGen.Phase.TypeCheck);
assertEquals("return Phi(Region,0,1);", code.print());
assertEquals("1", Eval2.eval(code, 0));
- testCPU(src,"x86_64_v2", "win64",23,null);
+ testCPU(src,"x86_64_v2", "win64",31,null);
+ TestC.runSF(src.replace("return _s.peek('q');","return _s.peek('q') != 1;"),"frefFields","",-1);
};
@Test