Skip to content

Commit 22f1694

Browse files
committed
Skip all abstractions that do not contain any path information in the path builder
Ensures that each cached SourceContextAndPath represents a progress in the path such that the filling up deferred paths never infinite loops
1 parent e1916b0 commit 22f1694

1 file changed

Lines changed: 7 additions & 9 deletions

File tree

soot-infoflow/src/soot/jimple/infoflow/data/pathBuilders/ContextSensitivePathBuilder.java

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,13 @@ public SourceFindingTask(Abstraction abstraction) {
7676
@Override
7777
public void run() {
7878
final Set<SourceContextAndPath> paths = pathCache.get(abstraction);
79-
final Abstraction pred = abstraction.getPredecessor();
79+
Abstraction pred = abstraction.getPredecessor();
80+
81+
// Skip abstractions that don't contain any new information. This might
82+
// be the case when a turn unit was added to the abstraction.
83+
while (pred != null && pred.getCurrentStmt() == null && pred.getCorrespondingCallSite() == null) {
84+
pred = pred.getPredecessor();
85+
}
8086

8187
if (pred != null && paths != null) {
8288
for (SourceContextAndPath scap : paths) {
@@ -94,14 +100,6 @@ public void run() {
94100
}
95101

96102
private void processAndQueue(Abstraction pred, SourceContextAndPath scap) {
97-
// Skip abstractions that don't contain any new information. This might
98-
// be the case when a turn unit was added to the abstraction.
99-
if (pred.getCorrespondingCallSite() == null && pred.getCurrentStmt() == null
100-
&& pred.getTurnUnit() != null) {
101-
processAndQueue(pred.getPredecessor(), scap);
102-
return;
103-
}
104-
105103
ProcessingResult p = processPredecessor(scap, pred);
106104
switch (p.getResult()) {
107105
case NEW:

0 commit comments

Comments
 (0)