Package soot.jimple.infoflow.data
Class AccessPath
java.lang.Object
soot.jimple.infoflow.data.AccessPath
- All Implemented Interfaces:
Cloneable
This class represents the taint, containing a base value and a list of fields
(length is bounded by Infoflow.ACCESSPATHLENGTH)
-
Nested Class Summary
Nested Classes -
Method Summary
Modifier and TypeMethodDescriptionstatic booleancanContainValue(soot.Value val) Checks whether the given value can be the base value value of an access pathclone()Gets a copy of this access path, but drops the last field.booleanentails(AccessPath a2) Checks whether this access path entails the given one, i.e. refers to all objects the other access path also refers to.booleanbooleanbooleanfirstFieldMatches(soot.SootField field) Checks whether the first field of this access path matches the given fieldGets whether this access path references only the length of the array to which it points, not the contents of that arrayGets the type of the base valuesoot.TypeGets the type of the base valuebooleanReturns whether the tainted object can have immutable aliases.soot.Valuestatic AccessPathsoot.SootFieldGets the first field in the sequence of field dereferencessoot.TypeGets the type of the first field in the sequence of field dereferencesGets the first fragment in the sequence of field dereferencesintGets the number of field dereferences in this access pathGets the sequence of field dereferences in this access pathintsoot.SootFieldGets the last field in the sequence of field dereferencessoot.TypeGets the type of the last field in the sequence of field dereferencesGets the last fragment in the sequence of field dereferencessoot.LocalbooleanGets whether sub-fields shall be tainted.inthashCode()intbooleanGets whether this access path has been (transitively) constructed from one which was cut off by the access path length limitation.booleanisEmpty()Gets whether this access path is empty, i.e., references nothingbooleanbooleanbooleanisLocal()booleanbooleanstartsWith(soot.Value val) Checks whether this access path starts with the given valuetoString()
-
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
Gets the last fragment in the sequence of field dereferences- Returns:
- The last fragment in the sequence of field dereferences
-
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
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() -
hashCodeWithoutContext
public int hashCodeWithoutContext() -
getHashCode
public int getHashCode() -
equals
-
equalsWithoutContext
-
isStaticFieldRef
public boolean isStaticFieldRef() -
isInstanceFieldRef
public boolean isInstanceFieldRef() -
isFieldRef
public boolean isFieldRef() -
isLocal
public boolean isLocal() -
toString
-
clone
-
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
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
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
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
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.
-