summaryrefslogtreecommitdiff
path: root/chapter15/src/main/java/com
diff options
context:
space:
mode:
authorCliff Click <cliffc@acm.org>2024-10-11 12:22:21 -0700
committerCliff Click <cliffc@acm.org>2024-10-12 11:39:00 -0700
commit96d028ce004f5b4581997fd1d1a0ccfa87d67ea3 (patch)
treee2a33abe9c4c0e3ada4d733bbc109f705ea31da8 /chapter15/src/main/java/com
parent4dd51b1b14dfffb9f0ee184413f45285cc867fda (diff)
downloadSimple-96d028ce004f5b4581997fd1d1a0ccfa87d67ea3.tar.gz
Simple-96d028ce004f5b4581997fd1d1a0ccfa87d67ea3.zip
Fix a null-check bug
Diffstat (limited to 'chapter15/src/main/java/com')
-rw-r--r--chapter15/src/main/java/com/seaofnodes/simple/Parser.java6
1 files changed, 3 insertions, 3 deletions
diff --git a/chapter15/src/main/java/com/seaofnodes/simple/Parser.java b/chapter15/src/main/java/com/seaofnodes/simple/Parser.java
index 012a010e..728aaca7 100644
--- a/chapter15/src/main/java/com/seaofnodes/simple/Parser.java
+++ b/chapter15/src/main/java/com/seaofnodes/simple/Parser.java
@@ -807,7 +807,7 @@ public class Parser {
val = zsMask(val,f._type);
Node st = new StoreNode(name, f._alias, f._type, memAlias(f._alias), expr, off, val, false);
// Arrays include control, as a proxy for a safety range check.
- // Structs dont need this; they only need a NPE check which is
+ // Structs don't need this; they only need a NPE check which is
// done via the type system.
if( base.isAry() ) st.setDef(0,ctrl());
memAlias(f._alias, st.peephole());
@@ -815,9 +815,9 @@ public class Parser {
}
}
- Node load = new LoadNode(name, f._alias, f._type, memAlias(f._alias), expr, off);
+ Node load = new LoadNode(name, f._alias, f._type.glb(), memAlias(f._alias), expr, off);
// Arrays include control, as a proxy for a safety range check
- // Structs dont need this; they only need a NPE check which is
+ // Structs don't need this; they only need a NPE check which is
// done via the type system.
if( base.isAry() ) load.setDef(0,ctrl());
return parsePostfix(load.peephole());