Search in sources :

Example 36 with SegmentNode

use of soot.jimple.spark.geom.dataRep.SegmentNode in project soot by Sable.

the class PtInsIntervalManager method removeUselessSegments.

public void removeUselessSegments() {
    int i;
    SegmentNode p, q, temp;
    p = header[ONE_TO_ONE];
    size[ONE_TO_ONE] = 0;
    q = null;
    while (p != null) {
        boolean contained = false;
        for (i = 0; i < 2; ++i) {
            temp = header[i];
            while (temp != null) {
                if (temp.I1 == 0 || ((temp.I1 <= p.I1) && (temp.I1 + temp.L >= p.I1 + p.L))) {
                    if (temp.I2 == 0 || ((temp.I2 <= p.I2) && (temp.I2 + temp.L >= p.I2 + p.L))) {
                        contained = true;
                        break;
                    }
                }
                temp = temp.next;
            }
        }
        temp = p.next;
        if (contained == false) {
            p.next = q;
            q = p;
            ++size[ONE_TO_ONE];
        }
        p = temp;
    }
    header[ONE_TO_ONE] = q;
}
Also used : SegmentNode(soot.jimple.spark.geom.dataRep.SegmentNode)

Example 37 with SegmentNode

use of soot.jimple.spark.geom.dataRep.SegmentNode in project soot by Sable.

the class PtInsNode method count_new_pts_intervals.

@Override
public int count_new_pts_intervals() {
    int ans = 0;
    for (PtInsIntervalManager im : new_pts.values()) {
        SegmentNode[] int_entry = im.getFigures();
        for (int i = 0; i < PtInsIntervalManager.Divisions; ++i) {
            SegmentNode p = int_entry[i];
            while (p != null && p.is_new == true) {
                ++ans;
                p = p.next;
            }
        }
    }
    return ans;
}
Also used : PlainConstraint(soot.jimple.spark.geom.dataRep.PlainConstraint) SegmentNode(soot.jimple.spark.geom.dataRep.SegmentNode)

Example 38 with SegmentNode

use of soot.jimple.spark.geom.dataRep.SegmentNode in project soot by Sable.

the class PtInsNode method heap_sensitive_intersection.

/**
 * Query if this pointer and qv could point to the same object under any contexts
 */
@Override
public boolean heap_sensitive_intersection(IVarAbstraction qv) {
    int i, j;
    PtInsNode qn;
    SegmentNode p, q, pt[], qt[];
    qn = (PtInsNode) qv;
    for (Iterator<AllocNode> it = pt_objs.keySet().iterator(); it.hasNext(); ) {
        AllocNode an = it.next();
        if (an instanceof StringConstantNode)
            continue;
        qt = qn.find_points_to(an);
        if (qt == null)
            continue;
        pt = find_points_to(an);
        for (i = 0; i < PtInsIntervalManager.Divisions; ++i) {
            p = pt[i];
            while (p != null) {
                for (j = 0; j < PtInsIntervalManager.Divisions; ++j) {
                    q = qt[j];
                    while (q != null) {
                        if (quick_intersecting_test(p, q))
                            return true;
                        q = q.next;
                    }
                }
                p = p.next;
            }
        }
    }
    return false;
}
Also used : AllocNode(soot.jimple.spark.pag.AllocNode) StringConstantNode(soot.jimple.spark.pag.StringConstantNode) PlainConstraint(soot.jimple.spark.geom.dataRep.PlainConstraint) SegmentNode(soot.jimple.spark.geom.dataRep.SegmentNode)

Example 39 with SegmentNode

use of soot.jimple.spark.geom.dataRep.SegmentNode in project soot by Sable.

the class PtInsNode method pointer_interval_points_to.

@Override
public boolean pointer_interval_points_to(long l, long r, AllocNode obj) {
    SegmentNode[] int_entry = find_points_to(obj);
    // Check all-to-many figures
    if (int_entry[PtInsIntervalManager.ALL_TO_MANY] != null)
        return true;
    for (int i = 1; i < HeapInsIntervalManager.Divisions; ++i) {
        SegmentNode p = int_entry[i];
        while (p != null) {
            long R = p.I1 + p.L;
            if ((l <= p.I1 && p.I1 < r) || (p.I1 <= l && l < R))
                return true;
            p = p.next;
        }
    }
    return false;
}
Also used : PlainConstraint(soot.jimple.spark.geom.dataRep.PlainConstraint) SegmentNode(soot.jimple.spark.geom.dataRep.SegmentNode)

Example 40 with SegmentNode

use of soot.jimple.spark.geom.dataRep.SegmentNode in project soot by Sable.

the class FullSensitiveNode method count_new_pts_intervals.

@Override
public int count_new_pts_intervals() {
    int ans = 0;
    for (GeometricManager gm : new_pts.values()) {
        SegmentNode[] int_entry = gm.getFigures();
        for (int i = 0; i < GeometricManager.Divisions; ++i) {
            SegmentNode p = int_entry[i];
            while (p != null && p.is_new == true) {
                ++ans;
                p = p.next;
            }
        }
    }
    return ans;
}
Also used : PlainConstraint(soot.jimple.spark.geom.dataRep.PlainConstraint) SegmentNode(soot.jimple.spark.geom.dataRep.SegmentNode)

Aggregations

SegmentNode (soot.jimple.spark.geom.dataRep.SegmentNode)51 PlainConstraint (soot.jimple.spark.geom.dataRep.PlainConstraint)24 AllocNode (soot.jimple.spark.pag.AllocNode)12 HashMap (java.util.HashMap)6 Map (java.util.Map)6 RectangleNode (soot.jimple.spark.geom.dataRep.RectangleNode)5 SootMethod (soot.SootMethod)3 GeomPointsTo (soot.jimple.spark.geom.geomPA.GeomPointsTo)3 StringConstantNode (soot.jimple.spark.pag.StringConstantNode)3 ClassConstantNode (soot.jimple.spark.pag.ClassConstantNode)2