Skip to content

Commit

Permalink
Does not include the end position of a block in findChildNodeAt()
Browse files Browse the repository at this point in the history
  • Loading branch information
Horcrux7 committed May 27, 2022
1 parent bf58d29 commit d46050a
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/de/inetsoftware/jwebassembly/module/BranchManager.java
Original file line number Diff line number Diff line change
Expand Up @@ -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 );
}
}
Expand Down

0 comments on commit d46050a

Please sign in to comment.