Package sootup.spark

Class PointsToAnalysis

java.lang.Object
sootup.spark.PointsToAnalysis

public class PointsToAnalysis extends Object
Client-facing pointer analysis API over a SPARK 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:

  • Method Details

    • fromSolver

      public static PointsToAnalysis fromSolver(@NonNull @NonNull Solver solver)
      Builds a PointsToAnalysis over the PAG of solver. If the PAG has not yet been built (i.e. has no vertices), Solver.solve() is invoked first.
    • reachingObjects

      public Set<AllocationNode> reachingObjects(@NonNull @NonNull Node node)
      Returns the set of allocation sites that node may point to.

      For an AllocationNode the result is the singleton containing that allocation. For an InstanceFieldRefNode b.f the result is the union of heap[o, f] over each o in reachingObjects(b).

    • aliases

      public Set<Node> aliases(@NonNull @NonNull Node node)
      Returns the set of nodes (other than node itself) whose points-to set shares at least one allocation with reachingObjects(node) — i.e. nodes that may refer to a common run-time object. Only PAG vertices are considered as candidates.
    • reachingTypes

      public Set<Type> reachingTypes(@NonNull @NonNull Node node)
      Returns the set of run-time types that node's points-to set may induce.