diff --git a/src/de/inetsoftware/jwebassembly/module/BranchManager.java b/src/de/inetsoftware/jwebassembly/module/BranchManager.java index 52aae044..e57bafd3 100644 --- a/src/de/inetsoftware/jwebassembly/module/BranchManager.java +++ b/src/de/inetsoftware/jwebassembly/module/BranchManager.java @@ -554,7 +554,7 @@ private void calculateIf( BranchNode parent, IfParsedBlock startBlock, List= endPos ) { @@ -566,17 +566,14 @@ private void calculateIf( BranchNode parent, IfParsedBlock startBlock, List breakBlock.breakPos ) { + branch.add( i, breakNode ); + return; + } + } branch.add( breakNode ); } @@ -1720,7 +1726,7 @@ private static class BranchNode extends ArrayList { public boolean add( BranchNode node ) { node.parent = this; assert node.startOp == null || (node.startPos >= startPos && node.endPos <= endPos): "Node outside parent: " + this + " + " + node; -// assert !overlapped( node.startPos ) : "Node on wrong level: " + node + "; parent: " + this + "; last: " + get( size() - 1 ); + assert node.startOp == null || !overlapped( node.startPos ) : "Node on wrong level: " + node + "; parent: " + this + "; last: " + get( size() - 1 ); return super.add( node ); }