Class SparkLibraryHelper

  • All Implemented Interfaces:
    Switch

    public class SparkLibraryHelper
    extends TypeSwitch
    This TypeSwitch can be used to add library behavior to the PAG. It adds allocation nodes with AnySubType of the declared type to the target node.
    Author:
    Florian Kuebler
    • Constructor Detail

      • SparkLibraryHelper

        public SparkLibraryHelper​(PAG pag,
                                  Node node,
                                  SootMethod method)
        The constructor for this TypeSwitch.
        Parameters:
        pag - the pointer assignment graph in that the new edges and nodes should be added into.
        node - the node of the value for which allocations should be made.
        method - the method in which the allocations should take place. This parameter can be null.
    • Method Detail

      • caseRefType

        public void caseRefType​(RefType t)
        A new local will be created and connected to node of type RefType. For this new local an allocation edge to AnySubType of its declared type will be added.
        Overrides:
        caseRefType in class TypeSwitch
      • caseArrayType

        public void caseArrayType​(ArrayType type)
        A new local array will be created and connected to node of type ArrayType. For this new local an allocation edge to a new array of its declared type will be added. If the ArrayType.getElementType() is still an array an allocation to a new array of this element type will be made and stored until the element type is a RefType. If this is the case an allocation to AnySubType of ArrayType.baseType will be made.
        Overrides:
        caseArrayType in class TypeSwitch