Class PointsToAnalysis
PAG.
Construct via fromSolver(Solver). The factory triggers Solver.solve() (if the
PAG has not yet been built) and then runs an Andersen-style fixed-point propagation over the
allocation, assignment, store, and load edges of the PAG. After construction the following
queries are supported, all keyed by Jimple Value (a local, field ref, parameter ref,
this, etc.) plus the MethodSignature of the method that contains the value:
reachingObjects(Value, MethodSignature)— the set ofAllocationNodes the value may point to.aliases(Value, MethodSignature)— the set of PAG vertices whose points-to set intersects the query value's.reachingTypes(Value, MethodSignature)— the set of run-timeTypes induced by the points-to set.
Values that the PAG does not model (numeric constants, arithmetic expressions, etc.) yield an
empty result. The raw PAG-level points-to map is also exposed via getPointsToMap() for
diagnostic purposes.
-
Method Summary
Modifier and TypeMethodDescriptionaliases(@NonNull Value value, @NonNull MethodSignature containingMethodSig) Returns the set of PAG vertices (other than the one forvalueitself) whose points-to set shares at least one allocation withreachingObjects(value, containingMethodSig)— i.e. nodes that may refer to a common run-time object.Read-only view of the raw PAG-level points-to map.reachingObjects(@NonNull Value value, @NonNull MethodSignature containingMethodSig) Returns the set of allocation sites thatvaluemay point to withincontainingMethodSig.reachingTypes(@NonNull Value value, @NonNull MethodSignature containingMethodSig) Returns the set of run-time types that the points-to set ofvaluemay induce withincontainingMethodSig.
-
Method Details
-
reachingObjects
public Set<AllocationNode> reachingObjects(@NonNull @NonNull Value value, @NonNull @NonNull MethodSignature containingMethodSig) Returns the set of allocation sites thatvaluemay point to withincontainingMethodSig.For an allocation expression the result is the singleton containing that allocation. For an instance field reference
b.fthe result is the union ofheap[o, f]over eachoinreachingObjects(b). Values not modeled by the PAG yield an empty set. -
aliases
public Set<Node> aliases(@NonNull @NonNull Value value, @NonNull @NonNull MethodSignature containingMethodSig) Returns the set of PAG vertices (other than the one forvalueitself) whose points-to set shares at least one allocation withreachingObjects(value, containingMethodSig)— i.e. nodes that may refer to a common run-time object. -
reachingTypes
public Set<Type> reachingTypes(@NonNull @NonNull Value value, @NonNull @NonNull MethodSignature containingMethodSig) Returns the set of run-time types that the points-to set ofvaluemay induce withincontainingMethodSig. -
getPointsToMap
Read-only view of the raw PAG-level points-to map. Intended for diagnostics and debugging that needs to walk every PAG vertex; prefer theValue-based query methods for analysis.
-