use of soot.jimple.spark.geom.geomPA.GeomPointsTo in project soot by Sable.
the class PtInsNode method injectPts.
@Override
public void injectPts() {
final GeomPointsTo geomPTA = (GeomPointsTo) Scene.v().getPointsToAnalysis();
pt_objs = new HashMap<AllocNode, PtInsIntervalManager>();
me.getP2Set().forall(new P2SetVisitor() {
@Override
public void visit(Node n) {
if (geomPTA.isValidGeometricNode(n))
pt_objs.put((AllocNode) n, (PtInsIntervalManager) stubManager);
}
});
new_pts = null;
}
use of soot.jimple.spark.geom.geomPA.GeomPointsTo in project soot by Sable.
the class FullSensitiveNode method injectPts.
/**
* We transfer the SPARK results to current pointer if this pointer is not involved in the geometric analysis.
* Note that, the unreachable objects will not be inserted.
*/
@Override
public void injectPts() {
final GeomPointsTo geomPTA = (GeomPointsTo) Scene.v().getPointsToAnalysis();
pt_objs = new HashMap<AllocNode, GeometricManager>();
me.getP2Set().forall(new P2SetVisitor() {
@Override
public void visit(Node n) {
if (geomPTA.isValidGeometricNode(n))
pt_objs.put((AllocNode) n, (GeometricManager) stubManager);
}
});
new_pts = null;
}
use of soot.jimple.spark.geom.geomPA.GeomPointsTo in project soot by Sable.
the class FullSensitiveNode method get_all_context_sensitive_objects.
@Override
public void get_all_context_sensitive_objects(long l, long r, PtSensVisitor visitor) {
if (parent != this) {
getRepresentative().get_all_context_sensitive_objects(l, r, visitor);
return;
}
GeomPointsTo geomPTA = (GeomPointsTo) Scene.v().getPointsToAnalysis();
for (Map.Entry<AllocNode, GeometricManager> entry : pt_objs.entrySet()) {
AllocNode obj = entry.getKey();
SootMethod sm = obj.getMethod();
int sm_int = geomPTA.getIDFromSootMethod(sm);
if (sm_int == -1)
continue;
GeometricManager gm = entry.getValue();
SegmentNode[] int_entry = gm.getFigures();
for (int i = 0; i < GeometricManager.Divisions; ++i) {
// We iterate all the figures
SegmentNode p = int_entry[i];
while (p != null) {
long L = p.I1;
long R = L + p.L;
long objL = -1, objR = -1;
// Now we compute which context sensitive objects are pointed to by this pointer
if (l <= L && L < r) {
// L------------R
if (i == GeometricManager.ONE_TO_ONE) {
long d = r - L;
if (R < r)
d = p.L;
objL = p.I2;
objR = objL + d;
} else {
objL = p.I2;
objR = p.I2 + ((RectangleNode) p).L_prime;
}
} else if (L <= l && l < R) {
// L--------------------R
if (i == GeometricManager.ONE_TO_ONE) {
long d = R - l;
if (R > r)
d = r - l;
objL = p.I2 + l - L;
objR = objL + d;
} else {
objL = p.I2;
objR = p.I2 + ((RectangleNode) p).L_prime;
}
}
// Now we test which context versions this interval [objL, objR) maps to
if (objL != -1 && objR != -1)
visitor.visit(obj, objL, objR, sm_int);
p = p.next;
}
}
}
}
Aggregations