Class DefaultForwardFlowFunction

    • Constructor Detail

      • DefaultForwardFlowFunction

        public DefaultForwardFlowFunction​(BoomerangOptions opts)
    • Method Detail

      • returnFlow

        public Set<Val> returnFlow​(Method method,
                                   Statement curr,
                                   Val value)
        Description copied from interface: IForwardFlowFunction
        Called by the forward analysis, when the forward solver reaches the returnStmt (any last statement of callee method) of callee method with data-flow fact returnedVal.
        Specified by:
        returnFlow in interface IForwardFlowFunction
        Parameters:
        method - The method the data-flow analysis returns from. The caller method is not available, as it will be internally added by the framework.
        curr - The statement from which the method returns from (will be any last/exit statement of the callee method)
        value - 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 Set<Val> callFlow​(Statement callSite,
                                 Val fact,
                                 Method callee)
        Description copied from interface: IForwardFlowFunction
        Called by the forward analysis, when the forward solver reaches the callSite. Will be invoked once per available callee (in the call graph).
        Specified by:
        callFlow in interface IForwardFlowFunction
        Parameters:
        callSite - A call site reached by the backward analysis.
        fact - The data-flow fact reaching the callSite
        callee - The callee that may be invoked at the callSite
        Returns:
        A set of data-flow facts (Val) that will be propagated at the entry statements of method callee
      • normalFlow

        public Set<wpds.interfaces.State> normalFlow​(ForwardQuery query,
                                                     ControlFlowGraph.Edge nextEdge,
                                                     Val fact)
        Description copied from interface: IForwardFlowFunction
        Called by the forward analysis, for any non return statements or call site statements.

        Note: The logic differs from general IFDS logic here. edge.getStart() 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:
        normalFlow in interface IForwardFlowFunction
        nextEdge - 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).
      • killFlow

        protected boolean killFlow​(Statement curr,
                                   Val value)
      • callToReturnFlow

        public Collection<wpds.interfaces.State> callToReturnFlow​(ForwardQuery query,
                                                                  ControlFlowGraph.Edge edge,
                                                                  Val fact)
        Description copied from interface: IForwardFlowFunction
        Called by the forward 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.getStart()), 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:
        callToReturnFlow in interface IForwardFlowFunction
        edge - Edge that bypasses the call site. edge.getStart() is the call site, edge.getTarget() is any succsessor
        fact - The fact that by-passes the call site.
        Returns:
        A set of data-flow states (states in the pushdown system, typically of type Node)