protected Abstraction(AccessPath apToTaint, SourceContext sourceContext, boolean exceptionThrown, boolean isImplicit) { this.sourceContext = sourceContext; this.accessPath = apToTaint; this.activationUnit = null; this.exceptionThrown = exceptionThrown; this.neighbors = null; this.isImplicit = isImplicit; this.currentStmt = sourceContext == null ? null : sourceContext.getStmt(); }
curAbs.getSourceContext().getAccessPath(), curAbs.getSourceContext().getStmt(), curAbs.getSourceContext().getUserData()).extendPath(curAbs); cacheData.add(sourceAndPath);
@Override protected boolean checkForSource(Abstraction abs, SourceContextAndPath scap) { // Record the abstraction visitedAbstractions.add(abs); // Source abstractions do not have predecessors if (abs.getPredecessor() != null) return false; // Save the abstraction path SummarySourceContextAndPath sscap = (SummarySourceContextAndPath) scap; SummarySourceInfo ssi = new SummarySourceInfo(abs.getSourceContext().getAccessPath(), abs.getSourceContext().getStmt(), abs.getSourceContext().getUserData(), sscap.getCurrentAccessPath(), sscap.getIsAlias(), !scap.isCallStackEmpty() || sscap.getDepth() != 0); ResultSinkInfo rsi = new ResultSinkInfo(null, scap.getAccessPath(), scap.getStmt()); this.resultInfos.add(new SummaryResultInfo(ssi, rsi)); return true; }
@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); } } }
&& abs.getSourceContext().getStmt() == stmt) return false;
/** * Checks whether the given abstraction is a source. If so, a result entry is * created. * * @param abs * The abstraction to check * @param scap * The path leading up to the current abstraction * @return True if the current abstraction is a source, otherwise false */ private boolean checkForSource(Abstraction abs, SourceContextAndPath scap) { if (abs.getPredecessor() != null) return false; // If we have no predecessors, this must be a source assert abs.getSourceContext() != null; assert abs.getNeighbors() == null; // Register the source that we have found SourceContext sourceContext = abs.getSourceContext(); results.addResult(scap.getDefinition(), scap.getAccessPath(), scap.getStmt(), sourceContext.getDefinition(), sourceContext.getAccessPath(), sourceContext.getStmt(), sourceContext.getUserData(), scap.getAbstractionPath()); return true; }
a.getAccessPath(), a.getCurrentStmt(), a.getSourceContext().getUserData(), a.getAccessPath(), isAliasedField(a.getAccessPath(), a.getSourceContext().getAccessPath(), a.getSourceContext().getStmt()), false));
/** * Checks whether the given abstraction is a source. If so, a result entry is * created. * * @param abs The abstraction to check * @param scap The path leading up to the current abstraction * @return True if the current abstraction is a source, otherwise false */ protected boolean checkForSource(Abstraction abs, SourceContextAndPath scap) { if (abs.getPredecessor() != null) return false; // If we have no predecessors, this must be a source assert abs.getSourceContext() != null; // A source should normally never have neighbors, but it can happen // with ICCTA if (abs.getNeighbors() != null) { // we ignore this issue for now, because the neighbor's source // contexts seem to be equal to our own one } // Register the source that we have found SourceContext sourceContext = abs.getSourceContext(); Pair<ResultSourceInfo, ResultSinkInfo> newResult = results.addResult(scap.getDefinition(), scap.getAccessPath(), scap.getStmt(), sourceContext.getDefinition(), sourceContext.getAccessPath(), sourceContext.getStmt(), sourceContext.getUserData(), scap.getAbstractionPath()); // Notify our handlers if (resultAvailableHandlers != null) for (OnPathBuilderResultAvailable handler : resultAvailableHandlers) handler.onResultAvailable(newResult.getO1(), newResult.getO2()); return true; }