Skip to content

Commit

Permalink
Fix wrong entrypoint logic
Browse files Browse the repository at this point in the history
  • Loading branch information
Kroppeb committed Aug 29, 2024
1 parent 3f3da9c commit d21ba2d
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ public record Results(

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

visitTree(entryPoint);
//
Expand Down Expand Up @@ -222,7 +224,7 @@ private Results getResults() {
}

// Add the first statement as an entry point
DomBlock first = this.sources.get(0);
DomBlock first = this.entryPoint;
entryPoints.get(statementToComponentMap.get(first)).add(first);

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

0 comments on commit d21ba2d

Please sign in to comment.