/** * Derives a new abstraction that models the current local being thrown as an * exception * * @param throwStmt The statement at which the exception was thrown * @return The newly derived abstraction */ public Abstraction deriveNewAbstractionOnThrow(Stmt throwStmt) { Abstraction abs = clone(); abs.currentStmt = throwStmt; abs.sourceContext = null; abs.exceptionThrown = true; return abs; }
public Abstraction dropTopPostdominator() { if (postdominators == null || postdominators.isEmpty()) return this; Abstraction abs = clone(); abs.sourceContext = null; abs.postdominators.remove(0); return abs; }
public Abstraction injectSourceContext(SourceContext sourceContext) { if (this.sourceContext != null && this.sourceContext.equals(sourceContext)) return this; Abstraction abs = clone(); abs.predecessor = null; abs.neighbors = null; abs.sourceContext = sourceContext; abs.currentStmt = this.currentStmt; return abs; }
public Abstraction getActiveCopy() { if (this.isAbstractionActive()) return this; Abstraction a = clone(); a.sourceContext = null; a.activationUnit = null; return a; }
/** * Creates a continuation at a gap. A continuation is a new abstraction without * a predecessor that has the gap definition as its source. * * @param source * The source abstraction that flowed into the gap * @param accessPath * The new acces path that shall be tainted after the gap * @param gap * @param stmt * @return */ private Abstraction getContinuation(Abstraction source, AccessPath accessPath, GapDefinition gap, Stmt stmt) { // Make sure that we don't break anything Abstraction newOutAbs = source.clone().deriveNewAbstraction(accessPath, stmt); // Create the source information pointing to the gap. This may not be unique newOutAbs.setPredecessor(null); // If no longer have a predecessor, we must fake a source context newOutAbs.setSourceContext(new SourceContext(null, accessPath, stmt, getFlowSource(accessPath, stmt, gap))); return newOutAbs; }
protected Abstraction deriveNewAbstractionMutable(AccessPath p, Stmt currentStmt) { // An abstraction needs an access path if (p == null) return null; if (this.accessPath.equals(p) && this.currentStmt == currentStmt) { Abstraction abs = clone(); abs.currentStmt = currentStmt; return abs; } Abstraction abs = new Abstraction(p, this); abs.predecessor = this; abs.currentStmt = currentStmt; abs.propagationPathLength = propagationPathLength + 1; if (!abs.getAccessPath().isEmpty()) abs.postdominators = null; if (!abs.isAbstractionActive()) abs.dependsOnCutAP = abs.dependsOnCutAP || p.isCutOffApproximation(); abs.sourceContext = null; return abs; }