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 trough 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. --------

  • Field Summary

    Fields inherited from class de.fraunhofer.aisec.cpg.passes.Pass

    lang, log
  • Constructor Summary

    Constructors
    Constructor Description
    ControlFlowSensitiveDFGPass()  
  • Method Summary

    Modifier and Type Method Description
    void accept​(TranslationResult translationResult)  
    void cleanup()  
    void handle​(de.fraunhofer.aisec.cpg.graph.Node node)
    ControlFlowSensitiveDFG Pass is perfomed on every Method

    Methods inherited from class de.fraunhofer.aisec.cpg.passes.Pass

    getLang, setLang, supportsLanguageFrontend

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface java.util.function.Consumer

    andThen
  • Constructor Details

    • ControlFlowSensitiveDFGPass

      public ControlFlowSensitiveDFGPass()
  • Method Details

    • cleanup

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

      public void accept​(TranslationResult translationResult)
    • handle

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