Class GeomQueries


  • public class GeomQueries
    extends Object
    A powerful interface for querying points-to results in many ways. It is an extension for SPARK standard querying system.
    Author:
    xiao
    • Field Detail

      • n_func

        protected int n_func
      • call_graph

        protected CgEdge[] call_graph
      • vis_cg

        protected int[] vis_cg
      • rep_cg

        protected int[] rep_cg
      • scc_size

        protected int[] scc_size
      • block_num

        protected int[] block_num
      • max_context_size_block

        protected long[] max_context_size_block
      • top_rank

        protected int[] top_rank
    • Constructor Detail

      • GeomQueries

        public GeomQueries​(GeomPointsTo geom_pta)
        We copy and make a condensed version of call graph.
        Parameters:
        geom_pts -
    • Method Detail

      • dfsScanSubgraph

        protected boolean dfsScanSubgraph​(int s,
                                          int target)
        Retrieve the subgraph from s->target. An edge s->t is included in the subgraph iff target is reachable from t.
        Parameters:
        s -
        target -
        Returns:
      • transferInSCC

        protected void transferInSCC​(int s,
                                     int t,
                                     long L,
                                     long R,
                                     ContextsCollector tContexts)
      • propagateIntervals

        protected boolean propagateIntervals​(int start,
                                             long L,
                                             long R,
                                             int target)
        Compute the mapping from interval [L, R) of method start to the intervals of method target. Return true if the mapping is feasible.
        Parameters:
        start -
        L -
        R -
        target -
        Returns:
      • contextsGoBy

        public boolean contextsGoBy​(Edge sootEdge,
                                    Local l,
                                    PtSensVisitor visitor)
        Answer contexts-go-by query. Usually, users specify the last K paths as the context. We call it k-CFA context. However, k-CFA is too restrictive. In contexts-go-by query, user specifies arbitrary call edge in the call graph. The query searches for all contexts induced by the specified call edge and collect points-to results under these contexts.
        Parameters:
        sootEdge - : the specified context edge in soot edge format
        l - : the querying pointer
        visitor - : container for querying result
        Returns:
        false, l does not have points-to information under the contexts induced by the given call edge
      • contextsGoBy

        public boolean contextsGoBy​(Edge sootEdge,
                                    Local l,
                                    SparkField field,
                                    PtSensVisitor visitor)
        Searching the points-to results for field expression such as p.f.
        Parameters:
        sootEdge -
        l -
        field -
        visitor -
        Returns:
      • kCFA

        public boolean kCFA​(Edge[] callEdgeChain,
                            Local l,
                            PtSensVisitor visitor)
        Standard K-CFA querying for arbitrary K.
        Parameters:
        callEdgeChain - : last K call edges leading to the method that contains l. callEdgeChain[0] is the farthest call edge in the chain.
        l - : the querying pointer
        visitor - : the querying result container
        Returns:
        false, l does not have points-to information under the given context
      • kCFA

        public boolean kCFA​(Edge[] callEdgeChain,
                            Local l,
                            SparkField field,
                            PtSensVisitor visitor)
        Standard K-CFA querying for field expression.
        Parameters:
        callEdgeChain - : callEdgeChain[0] is the farthest call edge in the chain.
        l -
        field -
        visitor -
        Returns:
      • isAliasCI

        public boolean isAliasCI​(Local l1,
                                 Local l2)
        Are the two pointers an alias with context insensitive points-to information?
      • isAlias

        public boolean isAlias​(IVarAbstraction pn1,
                               IVarAbstraction pn2)
        Test if two pointers given in geomPTA form are an alias under any contexts.
        Parameters:
        pn1 - and @param pn2 cannot be null.
      • isAlias

        public boolean isAlias​(Local l1,
                               Local l2)
        Decide if under any contexts, pointers @param l1 and @param l2 can be an alias.