From cab27a1f349f60eb8ee5bd97ac7fde5cd4547265 Mon Sep 17 00:00:00 2001 From: Cliff Click Date: Fri, 11 Sep 2026 17:12:32 -0700 Subject: Fix OR of 0 Allowed only if the replacement does not fall, will be lifted by OR to an TypeInteger --- chapter25/src/main/java/com/seaofnodes/simple/node/OrNode.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'chapter25/src') diff --git a/chapter25/src/main/java/com/seaofnodes/simple/node/OrNode.java b/chapter25/src/main/java/com/seaofnodes/simple/node/OrNode.java index ba250c26..66e561dc 100644 --- a/chapter25/src/main/java/com/seaofnodes/simple/node/OrNode.java +++ b/chapter25/src/main/java/com/seaofnodes/simple/node/OrNode.java @@ -27,7 +27,7 @@ public class OrNode extends ArithNode { // Or of 0. We do not check for (0|x) because this will already // canonicalize to (x|0) - if( t2.isConstant() && t2 instanceof TypeInteger i && i.value()==0 ) + if( t2.isConstant() && t2 instanceof TypeInteger i && i.value()==0 && t1.isa(TypeInteger.BOT) ) return lhs; // Move constants to RHS: con*arg becomes arg*con -- cgit v1.2.3