Skip to content

Commit 17321dc

Browse files
committed
allow the summary path builder to be re-used
1 parent 9e2b8a8 commit 17321dc

File tree

3 files changed

+20
-0
lines changed

3 files changed

+20
-0
lines changed

soot-infoflow-summaries/src/soot/jimple/infoflow/methodSummary/postProcessor/InfoflowResultPostProcessor.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -163,6 +163,7 @@ public MethodSummaries postProcess(MethodSummaries flows) {
163163
pathBuilder.clear();
164164
}
165165
}
166+
pathBuilder.shutdown();
166167
}
167168

168169
// Compact the flow set to remove paths that are over-approximations of

soot-infoflow-summaries/src/soot/jimple/infoflow/methodSummary/postProcessor/SummaryPathBuilder.java

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -253,4 +253,17 @@ protected Runnable getTaintPathTask(AbstractionAtSink abs) {
253253
return null;
254254
}
255255

256+
@Override
257+
protected void onTaintPathsComputed() {
258+
// Don't shut down the executor, because we reset it and run several iterations
259+
// on the same path builder.
260+
}
261+
262+
/**
263+
* Terminates the path builder. Afterwards, no new tasks can be scheduled.
264+
*/
265+
public void shutdown() {
266+
executor.shutdown();
267+
}
268+
256269
}

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

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -226,6 +226,12 @@ public void computeTaintPaths(Set<AbstractionAtSink> res) {
226226
} catch (InterruptedException e) {
227227
logger.error("Could not wait for executor termination", e);
228228
}
229+
}
230+
231+
/**
232+
* Method that is called when the taint paths have been computed
233+
*/
234+
protected void onTaintPathsComputed() {
229235
executor.shutdown();
230236
}
231237

0 commit comments

Comments
 (0)