Skip to content

Commit d21ba2d

Browse files
committed
Fix wrong entrypoint logic
1 parent 3f3da9c commit d21ba2d

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/org/jetbrains/java/decompiler/modules/decompiler/decompose/StrongConnectivityHelper2.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,7 @@ public record Results(
6565

6666
private final List<DomBlock> sources;
6767
private final Set<DomBlock> sourceSet;
68+
private final DomBlock entryPoint;
6869
private final List<List<DomBlock>> components = new ArrayList<>(); // List of strongly connected components, each entry is a list of statements that compose the component
6970
private final Set<DomBlock> processed = new HashSet<>(); // Already processed statements, persistent
7071
private final ListStack<DomBlock> stack = new ListStack<>(); // Stack of statements currently being tracked
@@ -77,6 +78,7 @@ public record Results(
7778
private StrongConnectivityHelper2(List<DomBlock> doms, DomBlock entryPoint) {
7879
this.sources = doms;
7980
this.sourceSet = new HashSet<>(doms);
81+
this.entryPoint = entryPoint;
8082

8183
visitTree(entryPoint);
8284
//
@@ -222,7 +224,7 @@ private Results getResults() {
222224
}
223225

224226
// Add the first statement as an entry point
225-
DomBlock first = this.sources.get(0);
227+
DomBlock first = this.entryPoint;
226228
entryPoints.get(statementToComponentMap.get(first)).add(first);
227229

228230
for (int i = 0; i < exitPoints.size(); i++) {

0 commit comments

Comments
 (0)