From e1b6befcfb865e0a8e34d895a0ddc82bf31d6d4b Mon Sep 17 00:00:00 2001 From: Cliff Click Date: Sun, 23 Mar 2025 10:01:32 -0700 Subject: Robust pre-encoding --- chapter21/src/main/java/com/seaofnodes/simple/print/ASMPrinter.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'chapter21/src/main/java/com/seaofnodes') diff --git a/chapter21/src/main/java/com/seaofnodes/simple/print/ASMPrinter.java b/chapter21/src/main/java/com/seaofnodes/simple/print/ASMPrinter.java index efa94b8b..cafa9e56 100644 --- a/chapter21/src/main/java/com/seaofnodes/simple/print/ASMPrinter.java +++ b/chapter21/src/main/java/com/seaofnodes/simple/print/ASMPrinter.java @@ -25,7 +25,7 @@ public abstract class ASMPrinter { // constant pool Encoding enc = code._encoding; - if( !enc._bigCons.isEmpty() ) { + if( enc!=null && !enc._bigCons.isEmpty() ) { sb.p("--- Constant Pool ------").nl(); for( Node relo : enc._bigCons.keySet() ) { Type t = enc._bigCons.get(relo); @@ -190,7 +190,7 @@ public abstract class ASMPrinter { sb.nl(); // Printing more op bits than fit - if( isMultiOp != null ) { + if( isMultiOp != null && code._encoding != null ) { // Multiple ops, template style, no RA, no scheduling. Print out // one-line-per-newline, with encoding bits up front. int size = code._encoding._opLen[n._nid]; -- cgit v1.2.3