From 3d226b49e1cd23b41fd9baf3917f751973c1ad11 Mon Sep 17 00:00:00 2001 From: Cliff Click Date: Sun, 27 Sep 2026 09:09:23 -0700 Subject: minor fixes Fix CI build Backport ch 23 fix to ch 22. --- chapter22/src/main/java/com/seaofnodes/simple/Parser.java | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'chapter22/src/main/java/com/seaofnodes') diff --git a/chapter22/src/main/java/com/seaofnodes/simple/Parser.java b/chapter22/src/main/java/com/seaofnodes/simple/Parser.java index 72fe6a71..087fd1fd 100644 --- a/chapter22/src/main/java/com/seaofnodes/simple/Parser.java +++ b/chapter22/src/main/java/com/seaofnodes/simple/Parser.java @@ -236,8 +236,13 @@ public class Parser { last = parseStatement(); // Last expression is the return except for the top-level main - if( ctrl()._type==Type.CONTROL && fun.sig() != _code._main ) - fun.addReturn(ctrl(), _scope.mem().merge(), last); + if( ctrl()._type==Type.CONTROL ) + if( fun.sig() != _code._main ) + fun.addReturn(ctrl(), _scope.mem().merge(), last); + else { + fun.setDef(1,XCTRL); // Kill default main + _code.addAll(fun._outputs); + } // Pop off the inProgress node on the multi-exit Region merge assert r.inProgress(); -- cgit v1.2.3