soot.jimple.infoflow.problems.rules.forward.StopAfterFirstKFlowsPropagationRule Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of soot-infoflow Show documentation
Show all versions of soot-infoflow Show documentation
Soot extending data flow tracking components for Java
The newest version!
package soot.jimple.infoflow.problems.rules.forward;
import java.util.Collection;
import soot.SootMethod;
import soot.jimple.Stmt;
import soot.jimple.infoflow.InfoflowManager;
import soot.jimple.infoflow.data.Abstraction;
import soot.jimple.infoflow.problems.TaintPropagationResults;
import soot.jimple.infoflow.problems.rules.AbstractTaintPropagationRule;
import soot.jimple.infoflow.util.ByReferenceBoolean;
public class StopAfterFirstKFlowsPropagationRule extends AbstractTaintPropagationRule {
public StopAfterFirstKFlowsPropagationRule(InfoflowManager manager, Abstraction zeroValue,
TaintPropagationResults results) {
super(manager, zeroValue, results);
}
/**
* Checks whether the data flow analysis must be stopped and sets the kill-flag
* if so
*
* @param killAll
* The variable that receives the kill-flag in case the analysis must
* be stopped
*/
private void checkStop(ByReferenceBoolean killAll) {
if (getManager().getConfig().getStopAfterFirstKFlows() <= getResults().getResults().size())
killAll.value = true;
}
@Override
public Collection propagateNormalFlow(Abstraction d1, Abstraction source, Stmt stmt, Stmt destStmt,
ByReferenceBoolean killSource, ByReferenceBoolean killAll) {
checkStop(killAll);
return null;
}
@Override
public Collection propagateCallFlow(Abstraction d1, Abstraction source, Stmt stmt, SootMethod dest,
ByReferenceBoolean killAll) {
checkStop(killAll);
return null;
}
@Override
public Collection propagateCallToReturnFlow(Abstraction d1, Abstraction source, Stmt stmt,
ByReferenceBoolean killSource, ByReferenceBoolean killAll) {
checkStop(killAll);
return null;
}
@Override
public Collection propagateReturnFlow(Collection callerD1s, Abstraction calleeD1, Abstraction source, Stmt stmt,
Stmt retSite, Stmt callSite, ByReferenceBoolean killAll) {
checkStop(killAll);
return null;
}
}