11package soot .jimple .infoflow .data .pathBuilders ;
22
33import java .util .Collection ;
4- import java .util .Collections ;
54import java .util .HashSet ;
65import java .util .Set ;
76import java .util .concurrent .PriorityBlockingQueue ;
2120import soot .jimple .infoflow .results .InfoflowResults ;
2221import soot .jimple .infoflow .results .ResultSinkInfo ;
2322import soot .jimple .infoflow .results .ResultSourceInfo ;
24- import soot .jimple .infoflow .river .SecondarySinkDefinition ;
2523import soot .jimple .infoflow .solver .executors .InterruptableExecutor ;
2624
2725/**
@@ -118,8 +116,8 @@ private void processAndQueue(Abstraction pred, SourceContextAndPath scap) {
118116 case CACHED :
119117 // In case we already know the subpath, we do append the path after the path
120118 // builder terminated
121- if (config .getPathConfiguration (). getPathReconstructionMode ()
122- != InfoflowConfiguration .PathReconstructionMode .NoPaths )
119+ if (config .getPathConfiguration ()
120+ . getPathReconstructionMode () != InfoflowConfiguration .PathReconstructionMode .NoPaths )
123121 deferredPaths .add (scap );
124122 break ;
125123 case INFEASIBLE_OR_MAX_PATHS_REACHED :
@@ -140,8 +138,7 @@ private PathProcessingResult processPredecessor(SourceContextAndPath scap, Abstr
140138
141139 if (checkForSource (pred , extendedScap ))
142140 sourceReachingScaps .add (extendedScap );
143- return pathCache .put (pred , extendedScap ) ? PathProcessingResult .NEW
144- : PathProcessingResult .CACHED ;
141+ return pathCache .put (pred , extendedScap ) ? PathProcessingResult .NEW : PathProcessingResult .CACHED ;
145142 }
146143
147144 // If we enter a method, we put it on the stack
@@ -229,10 +226,9 @@ protected boolean checkForSource(Abstraction abs, SourceContextAndPath scap) {
229226
230227 // Register the source that we have found
231228 SourceContext sourceContext = abs .getSourceContext ();
232- Collection <Pair <ResultSourceInfo , ResultSinkInfo >> newResults =
233- results .addResult (scap .getDefinitions (), scap .getAccessPath (), scap .getStmt (),
234- sourceContext .getDefinitions (), sourceContext .getAccessPath (), sourceContext .getStmt (),
235- sourceContext .getUserData (), scap .getAbstractionPath (), manager );
229+ Collection <Pair <ResultSourceInfo , ResultSinkInfo >> newResults = results .addResult (scap .getDefinitions (),
230+ scap .getAccessPath (), scap .getStmt (), sourceContext .getDefinitions (), sourceContext .getAccessPath (),
231+ sourceContext .getStmt (), sourceContext .getUserData (), scap .getAbstractionPath (), manager );
236232
237233 // Notify our handlers
238234 if (resultAvailableHandlers != null )
@@ -281,6 +277,14 @@ public void computeTaintPaths(Set<AbstractionAtSink> res) {
281277 }
282278 }
283279
280+ @ Override
281+ public void reset () {
282+ super .reset ();
283+ deferredPaths = new ConcurrentHashSet <>();
284+ sourceReachingScaps = new ConcurrentHashSet <>();
285+ pathCache = new ConcurrentIdentityHashMultiMap <>();
286+ }
287+
284288 /**
285289 * Tries to fill up deferred paths toward a source.
286290 */
0 commit comments