@Override public void run() { Stack<Pair<Stmt, Set<Abstraction>>> initialStack = new Stack<Pair<Stmt, Set<Abstraction>>>(); initialStack.push(new Pair<Stmt, Set<Abstraction>>(null, Collections.newSetFromMap(new IdentityHashMap<Abstraction, Boolean>()))); for (SourceContextAndPath context : getPaths(lastTaskId++, abs.getAbstraction(), initialStack)) { results.addResult(abs.getSinkDefinition(), abs.getAbstraction().getAccessPath(), abs.getSinkStmt(), context.getDefinition(), context.getAccessPath(), context.getStmt(), context.getUserData(), context.getAbstractionPath()); } }
AbstractionAtSink neighborAtSink = new AbstractionAtSink(abs.getSinkDefinition(), neighbor, abs.getSinkStmt()); task = getTaintPathTask(neighborAtSink);
@Override public void run() { while (!abstractionQueue.isEmpty()) { // Terminate the thread when we run out of memory if (isKilled()) { abstractionQueue.clear(); return; } Abstraction abstraction = abstractionQueue.remove(0); if (abstraction.getSourceContext() != null) { // Register the result results.addResult(flagAbs.getSinkDefinition(), flagAbs.getAbstraction().getAccessPath(), flagAbs.getSinkStmt(), abstraction.getSourceContext().getDefinition(), abstraction.getSourceContext().getAccessPath(), abstraction.getSourceContext().getStmt(), abstraction.getSourceContext().getUserData(), null); // Sources may not have predecessors assert abstraction.getPredecessor() == null; } else if (abstraction.getPredecessor().registerPathFlag(taskId, numTasks)) abstractionQueue.add(abstraction.getPredecessor()); if (abstraction.getNeighbors() != null) for (Abstraction nb : abstraction.getNeighbors()) if (nb.registerPathFlag(taskId, numTasks)) abstractionQueue.add(nb); } } }
@Override protected Runnable getTaintPathTask(final AbstractionAtSink abs) { SourceContextAndPath scap = new SourceContextAndPath(abs.getSinkDefinition(), abs.getAbstraction().getAccessPath(), abs.getSinkStmt()); scap = scap.extendPath(abs.getAbstraction(), pathConfig); if (pathCache.put(abs.getAbstraction(), scap)) if (!checkForSource(abs.getAbstraction(), scap)) return new SourceFindingTask(abs.getAbstraction()); return null; }
@Override protected Runnable getTaintPathTask(final AbstractionAtSink abs) { SourceContextAndPath scap = new SourceContextAndPath(abs.getSinkDefinition(), abs.getAbstraction().getAccessPath(), abs.getSinkStmt()); scap = scap.extendPath(abs.getAbstraction(), pathConfig); if (pathCache.put(abs.getAbstraction(), scap)) if (!checkForSource(abs.getAbstraction(), scap)) return new SourceFindingTask(abs.getAbstraction()); return null; }
resultAbs = new AbstractionAtSink(resultAbs.getSinkDefinition(), abs, resultAbs.getSinkStmt()); Abstraction newAbs = this.results.putIfAbsentElseGet(resultAbs, resultAbs.getAbstraction()); if (newAbs != resultAbs.getAbstraction())