Package boomerang.flowfunction
Class DefaultBackwardFlowFunction
- java.lang.Object
-
- boomerang.flowfunction.DefaultBackwardFlowFunction
-
- All Implemented Interfaces:
IBackwardFlowFunction
public class DefaultBackwardFlowFunction extends Object implements IBackwardFlowFunction
-
-
Constructor Summary
Constructors Constructor Description DefaultBackwardFlowFunction(BoomerangOptions opts)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Collection<Val>callFlow(Statement callSite, Val fact, Method callee, Statement calleeSp)Called by the backward analysis, when the backward solver reaches the callSite.Collection<wpds.interfaces.State>callToReturnFlow(ControlFlowGraph.Edge edge, Val fact)Called by the backward analysis, when data-flow by-passes a call site with data-flow fact.Collection<wpds.interfaces.State>normalFlow(ControlFlowGraph.Edge currEdge, Val fact)Called by the backward analysis, for any non return statements or call site statements.Collection<Val>returnFlow(Method callee, Statement returnStmt, Val returnedVal)Called by the backward analysis, when the backward solver reaches the returnStmt (first statement of callee method) of callee method with data-flow fact returnedVal.voidsetSolver(BackwardBoomerangSolver solver, com.google.common.collect.Multimap<Field,Statement> fieldLoadStatements, com.google.common.collect.Multimap<Field,Statement> fieldStoreStatements)protected Collection<wpds.interfaces.State>systemArrayCopyFlow(ControlFlowGraph.Edge edge, Val fact)
-
-
-
Constructor Detail
-
DefaultBackwardFlowFunction
public DefaultBackwardFlowFunction(BoomerangOptions opts)
-
-
Method Detail
-
returnFlow
public Collection<Val> returnFlow(Method callee, Statement returnStmt, Val returnedVal)
Description copied from interface:IBackwardFlowFunctionCalled by the backward analysis, when the backward solver reaches the returnStmt (first statement of callee method) of callee method with data-flow fact returnedVal.- Specified by:
returnFlowin interfaceIBackwardFlowFunction- Parameters:
callee- The method the data-flow analysis returns from. The caller method is not available, as it will be internally added by the framework.returnStmt- The statement from which the method returns from (will be the first statement of the callee method)returnedVal- The data-flow fact that is returned.- Returns:
- A set of data-flow facts (Val) which will be propagated at any call site of the callee method.
-
callFlow
public Collection<Val> callFlow(Statement callSite, Val fact, Method callee, Statement calleeSp)
Description copied from interface:IBackwardFlowFunctionCalled by the backward analysis, when the backward solver reaches the callSite. Will be invoked once per available callee (in the call graph).- Specified by:
callFlowin interfaceIBackwardFlowFunction- Parameters:
callSite- A call site reached by the backward analysis.fact- The data-flow fact reaching the callSitecallee- The callee that may be invoked at the callSitecalleeSp- The start point of callee (in the backward analysis, this typically will be return or throw statements)- Returns:
- A set of data-flow facts (Val) that will be propagated at the calleeSp
-
normalFlow
public Collection<wpds.interfaces.State> normalFlow(ControlFlowGraph.Edge currEdge, Val fact)
Description copied from interface:IBackwardFlowFunctionCalled by the backward analysis, for any non return statements or call site statements. Note: The logic differs from general IFDS logic here. edge.getTarget() can also contain a call site, but fact is not used in the call site (no parameter or base variable of the call expression) .- Specified by:
normalFlowin interfaceIBackwardFlowFunction- Parameters:
currEdge- The control-flow graph edge that will be propagated next.fact- The incoming data-flow fact that reaches the edge.- Returns:
- A set of data-flow states (states in the pushdown system, typically of type
Node
).
-
callToReturnFlow
public Collection<wpds.interfaces.State> callToReturnFlow(ControlFlowGraph.Edge edge, Val fact)
Description copied from interface:IBackwardFlowFunctionCalled by the backward analysis, when data-flow by-passes a call site with data-flow fact. Here logic can be added to handle native calls, or methods that are excluded from propagation. Note: The logic differs from general IFDS logic here. callToReturn is _only_ invoked when fact is also used in the call site (edge.getTarget()), i.e. fact is a parameter or the base variable of the call expression. As a consequence, special handling for call site may need to be implemented as part of callToReturn and normalFlow.- Specified by:
callToReturnFlowin interfaceIBackwardFlowFunction- Parameters:
edge- Edge that bypasses the call site. edge.getTarget() is the call site, edge.getStart() is any predecessorfact- The fact that by-passes the call site.- Returns:
- A set of data-flow states (states in the pushdown system, typically of type
Node
)
-
setSolver
public void setSolver(BackwardBoomerangSolver solver, com.google.common.collect.Multimap<Field,Statement> fieldLoadStatements, com.google.common.collect.Multimap<Field,Statement> fieldStoreStatements)
- Specified by:
setSolverin interfaceIBackwardFlowFunction
-
systemArrayCopyFlow
protected Collection<wpds.interfaces.State> systemArrayCopyFlow(ControlFlowGraph.Edge edge, Val fact)
-
-