Skip to content

Commit

Permalink
fix: removeUnreachable not searching in all blocks (PR #2082)
Browse files Browse the repository at this point in the history
Co-authored-by: Away-pp <vladimir@DESKTOP-KESF23K>
  • Loading branch information
Away-pp and Away-pp authored Jan 14, 2024
1 parent 03052ba commit 2805770
Showing 1 changed file with 2 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -644,14 +644,13 @@ public static void removeMarkedBlocks(MethodNode mth) {
}

private static void removeUnreachableBlocks(MethodNode mth) {
Set<BlockNode> toRemove = null;
Set<BlockNode> toRemove = new LinkedHashSet<>();
for (BlockNode block : mth.getBasicBlocks()) {
if (block.getPredecessors().isEmpty() && block != mth.getEnterBlock()) {
toRemove = new LinkedHashSet<>();
BlockSplitter.collectSuccessors(block, mth.getEnterBlock(), toRemove);
}
}
if (toRemove == null || toRemove.isEmpty()) {
if (toRemove.isEmpty()) {
return;
}

Expand Down

0 comments on commit 2805770

Please sign in to comment.