Search in sources :

Example 16 with PointsToSet

use of soot.PointsToSet in project soot by Sable.

the class PointsToAnalysis method printLocalIntersects.

private static void printLocalIntersects(Map ls) {
    soot.PointsToAnalysis pta = Scene.v().getPointsToAnalysis();
    Iterator i1 = ls.entrySet().iterator();
    while (i1.hasNext()) {
        Map.Entry e1 = (Map.Entry) i1.next();
        int p1 = ((Integer) e1.getKey()).intValue();
        Local l1 = (Local) e1.getValue();
        PointsToSet r1 = pta.reachingObjects(l1);
        Iterator i2 = ls.entrySet().iterator();
        while (i2.hasNext()) {
            Map.Entry e2 = (Map.Entry) i2.next();
            int p2 = ((Integer) e2.getKey()).intValue();
            Local l2 = (Local) e2.getValue();
            PointsToSet r2 = pta.reachingObjects(l2);
            if (p1 <= p2)
                System.out.println("[" + p1 + "," + p2 + "]\t Container intersect? " + r1.hasNonEmptyIntersection(r2));
        }
    }
}
Also used : PointsToSet(soot.PointsToSet) Iterator(java.util.Iterator) Local(soot.Local) HashMap(java.util.HashMap) Map(java.util.Map)

Example 17 with PointsToSet

use of soot.PointsToSet in project soot by Sable.

the class DemandCSPointsTo method computeReachingObjects.

/**
 * Computes the possibly refined set of reaching objects for l.
 */
protected PointsToSet computeReachingObjects(Local l) {
    VarNode v = pag.findLocalVarNode(l);
    if (v == null) {
        // no reaching objects
        return EmptyPointsToSet.v();
    }
    PointsToSet contextSensitiveResult = computeRefinedReachingObjects(v);
    if (contextSensitiveResult == null) {
        // had to abort; return Spark's points-to set in a wrapper
        return new WrappedPointsToSet(v.getP2Set());
    } else {
        return contextSensitiveResult;
    }
}
Also used : GlobalVarNode(soot.jimple.spark.pag.GlobalVarNode) LocalVarNode(soot.jimple.spark.pag.LocalVarNode) VarNode(soot.jimple.spark.pag.VarNode) EmptyPointsToSet(soot.jimple.spark.sets.EmptyPointsToSet) EqualsSupportingPointsToSet(soot.jimple.spark.sets.EqualsSupportingPointsToSet) HybridPointsToSet(soot.jimple.spark.sets.HybridPointsToSet) PointsToSet(soot.PointsToSet)

Aggregations

PointsToSet (soot.PointsToSet)17 Local (soot.Local)5 EqualsSupportingPointsToSet (soot.jimple.spark.sets.EqualsSupportingPointsToSet)5 EmptyPointsToSet (soot.jimple.spark.sets.EmptyPointsToSet)4 HybridPointsToSet (soot.jimple.spark.sets.HybridPointsToSet)4 HashMap (java.util.HashMap)3 Iterator (java.util.Iterator)3 Map (java.util.Map)2 SootField (soot.SootField)2 Type (soot.Type)2 Value (soot.Value)2 ArrayRef (soot.jimple.ArrayRef)2 InstanceFieldRef (soot.jimple.InstanceFieldRef)2 FlowFunction (heros.FlowFunction)1 FlowFunctions (heros.FlowFunctions)1 ArrayList (java.util.ArrayList)1 Collection (java.util.Collection)1 HashSet (java.util.HashSet)1 LinkedHashSet (java.util.LinkedHashSet)1 Set (java.util.Set)1