Class AccessPath

java.lang.Object
soot.jimple.infoflow.data.AccessPath
All Implemented Interfaces:
Cloneable

public class AccessPath extends Object implements Cloneable
This class represents the taint, containing a base value and a list of fields (length is bounded by Infoflow.ACCESSPATHLENGTH)
  • Method Details

    • canContainValue

      public static boolean canContainValue(soot.Value val)
      Checks whether the given value can be the base value value of an access path
      Parameters:
      val - The value to check
      Returns:
      True if the given value can be the base value value of an access path
    • getPlainValue

      public soot.Local getPlainValue()
    • getCompleteValue

      public soot.Value getCompleteValue()
    • getLastFragment

      public AccessPathFragment getLastFragment()
      Gets the last fragment in the sequence of field dereferences
      Returns:
      The last fragment in the sequence of field dereferences
    • getFirstFragment

      public AccessPathFragment getFirstFragment()
      Gets the first fragment in the sequence of field dereferences
      Returns:
      The first fragment in the sequence of field dereferences
    • getFirstField

      public soot.SootField getFirstField()
      Gets the first field in the sequence of field dereferences
      Returns:
      The first field in the sequence of field dereferences
    • getLastField

      public soot.SootField getLastField()
      Gets the last field in the sequence of field dereferences
      Returns:
      The last field in the sequence of field dereferences
    • getFirstFieldType

      public soot.Type getFirstFieldType()
      Gets the type of the first field in the sequence of field dereferences
      Returns:
      The type of the first field in the sequence of field dereferences
    • getLastFieldType

      public soot.Type getLastFieldType()
      Gets the type of the last field in the sequence of field dereferences
      Returns:
      The type of the last field in the sequence of field dereferences
    • firstFieldMatches

      public boolean firstFieldMatches(soot.SootField field)
      Checks whether the first field of this access path matches the given field
      Parameters:
      field - The field to check against
      Returns:
      True if this access path has a non-empty field list and the first field matches the given one, otherwise false
    • getFragments

      public AccessPathFragment[] getFragments()
      Gets the sequence of field dereferences in this access path
      Returns:
      The sequence of field dereferences in this access path
    • getFragmentCount

      public int getFragmentCount()
      Gets the number of field dereferences in this access path
      Returns:
      The number of field dereferences in this access path
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • hashCodeWithoutContext

      public int hashCodeWithoutContext()
    • getHashCode

      public int getHashCode()
    • equals

      public boolean equals(Object obj)
      Overrides:
      equals in class Object
    • equalsWithoutContext

      public boolean equalsWithoutContext(Object obj)
    • isStaticFieldRef

      public boolean isStaticFieldRef()
    • isInstanceFieldRef

      public boolean isInstanceFieldRef()
    • isFieldRef

      public boolean isFieldRef()
    • isLocal

      public boolean isLocal()
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • clone

      public AccessPath clone()
      Overrides:
      clone in class Object
    • getEmptyAccessPath

      public static AccessPath getEmptyAccessPath()
    • isEmpty

      public boolean isEmpty()
      Gets whether this access path is empty, i.e., references nothing
      Returns:
      True if this access path is empty, false otherwise
    • entails

      public boolean entails(AccessPath a2)
      Checks whether this access path entails the given one, i.e. refers to all objects the other access path also refers to.
      Parameters:
      a2 - The other access path
      Returns:
      True if this access path refers to all objects the other access path also refers to
    • dropLastField

      public AccessPath dropLastField()
      Gets a copy of this access path, but drops the last field. If this access path has no fields, the identity is returned.
      Returns:
      A copy of this access path with the last field being dropped.
    • getBaseType

      public soot.Type getBaseType()
      Gets the type of the base value
      Returns:
      The type of the base value
    • getBaseContext

      public ContainerContext[] getBaseContext()
      Gets the type of the base value
      Returns:
      The type of the base value
    • getTaintSubFields

      public boolean getTaintSubFields()
      Gets whether sub-fields shall be tainted. If this access path is e.g. a.b.*, the result is true, whereas it is false for a.b.
      Returns:
      True if this access path includes all objects rechable through it, otherwise false
    • isCutOffApproximation

      public boolean isCutOffApproximation()
      Gets whether this access path has been (transitively) constructed from one which was cut off by the access path length limitation. If this is the case, this AP might not be precise.
      Returns:
      True if this access path was constructed from a cut-off one.
    • getArrayTaintType

      public AccessPath.ArrayTaintType getArrayTaintType()
      Gets whether this access path references only the length of the array to which it points, not the contents of that array
      Returns:
      True if this access paths points refers to the length of an array instead of to its contents
    • startsWith

      public boolean startsWith(soot.Value val)
      Checks whether this access path starts with the given value
      Parameters:
      val - The value that is a potential prefix of the current access path
      Returns:
      True if this access paths with the given value (i.e., the given value is a prefix of this access path), otherwise false
    • getCanHaveImmutableAliases

      public boolean getCanHaveImmutableAliases()
      Returns whether the tainted object can have immutable aliases.
      Returns:
      true if the tainted object can have immutable aliases.