Class ControlFlowSensitiveDFGPass

java.lang.Object
de.fraunhofer.aisec.cpg.passes.Pass
de.fraunhofer.aisec.cpg.passes.ControlFlowSensitiveDFGPass
All Implemented Interfaces:
java.util.function.Consumer<TranslationResult>

public class ControlFlowSensitiveDFGPass
extends Pass
This pass tracks VariableDeclarations and values that are included in the graph by the DFG edge. For this pass we traverse the EOG as it represents our understanding of the execution order and can be used to remove the DFG edges that are not feasible.

Control Flow Sensitivity in the DFG is only performed on VariableDeclarations and not on FieldDeclarations. The reason for this being the fact, that the value of a field might be modified to a value that is not present in the method, thus it is not detected by our variable tracking

This pass will split up at every branch in the EOG. Because of the existence of loops and multiple paths being able to run to through the same Declared reference expression we have to keep track of the set of values (assignments) associated to a variable at JoinPoints. If the set reaching a Joinpoint is not adding new values to one variable the path does not have to be further explored. This ensures that the algorithm terminates and scales with the number of different paths in the program finally reaching a fixpoint.

This is only feasible because the values associate to a variable at fix-points is the location assignment and not its symbolically executed value, in which case we could not ensure termination for the algorithm.

We here do not solve the problem of Exception-Handling, for this we will need additional semantics on Edges.

  • Constructor Details

    • ControlFlowSensitiveDFGPass

      public ControlFlowSensitiveDFGPass()
  • Method Details

    • cleanup

      public void cleanup()
      Specified by:
      cleanup in class Pass
    • accept

      public void accept​(TranslationResult translationResult)
    • removeValues

      protected void removeValues​(ControlFlowSensitiveDFGPass.FunctionLevelFixpointIterator fixDFGs)
      Removes unrefined DFG edges
      Parameters:
      fixDFGs - ControlFlowSensitiveDFG of entire Method
    • handle

      protected void handle​(de.fraunhofer.aisec.cpg.graph.Node node)
      ControlFlowSensitiveDFG Pass is performed on every method.
      Parameters:
      node - every node in the TranslationResult