From d46050a3a3cca7f2862e618358a70bb56bc75014 Mon Sep 17 00:00:00 2001 From: Volker Berlin Date: Fri, 27 May 2022 21:42:09 +0200 Subject: [PATCH] Does not include the end position of a block in findChildNodeAt() --- src/de/inetsoftware/jwebassembly/module/BranchManager.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/de/inetsoftware/jwebassembly/module/BranchManager.java b/src/de/inetsoftware/jwebassembly/module/BranchManager.java index 66538b00..a5078489 100644 --- a/src/de/inetsoftware/jwebassembly/module/BranchManager.java +++ b/src/de/inetsoftware/jwebassembly/module/BranchManager.java @@ -739,7 +739,8 @@ private int findIdxOfCodePos( int codePosition ) { @Nonnull private BranchNode findChildNodeAt( @Nonnull BranchNode parent, int codePosition ) { for( BranchNode node : parent ) { - if( node.startPos <= codePosition && codePosition <= node.endPos ) { + // the end position of a block is position of the first instruction outside of the block + if( node.startPos <= codePosition && codePosition < node.endPos ) { return findChildNodeAt( node, codePosition ); } }