use of soot.jimple.spark.pag.AllocNode in project soot by Sable.
the class PropIter method handleAllocNode.
/* End of public methods. */
/* End of package methods. */
/**
* Propagates new points-to information of node src to all its successors.
*/
protected final boolean handleAllocNode(AllocNode src) {
boolean ret = false;
Node[] targets = pag.allocLookup(src);
for (Node element : targets) {
ret = element.makeP2Set().add(src) | ret;
}
return ret;
}
use of soot.jimple.spark.pag.AllocNode in project soot by Sable.
the class PropIter method handleLoads.
protected final boolean handleLoads(FieldRefNode src) {
boolean ret = false;
final Node[] loadTargets = pag.loadLookup(src);
final SparkField f = src.getField();
ret = src.getBase().getP2Set().forall(new P2SetVisitor() {
public final void visit(Node n) {
AllocDotField nDotF = ((AllocNode) n).dot(f);
if (nDotF == null)
return;
PointsToSetInternal set = nDotF.getP2Set();
if (set.isEmpty())
return;
for (Node element : loadTargets) {
VarNode target = (VarNode) element;
if (target.makeP2Set().addAll(set, null)) {
returnValue = true;
}
}
}
}) | ret;
return ret;
}
use of soot.jimple.spark.pag.AllocNode in project soot by Sable.
the class PropWorklist method handleFieldRefNode.
/**
* Propagates new points-to information of node src to all its successors.
*/
protected final void handleFieldRefNode(FieldRefNode src, final HashSet<Object[]> edgesToPropagate) {
final Node[] loadTargets = pag.loadLookup(src);
if (loadTargets.length == 0)
return;
final SparkField field = src.getField();
src.getBase().getP2Set().forall(new P2SetVisitor() {
public final void visit(Node n) {
AllocDotField nDotF = pag.makeAllocDotField((AllocNode) n, field);
if (nDotF != null) {
PointsToSetInternal p2Set = nDotF.getP2Set();
if (!p2Set.getNewSet().isEmpty()) {
for (Node element : loadTargets) {
Object[] pair = { p2Set, element };
edgesToPropagate.add(pair);
}
}
}
}
});
}
use of soot.jimple.spark.pag.AllocNode in project soot by Sable.
the class PropWorklist method handleAllocNode.
/* End of public methods. */
/* End of package methods. */
/**
* Propagates new points-to information of node src to all its successors.
*/
protected final boolean handleAllocNode(AllocNode src) {
boolean ret = false;
Node[] targets = pag.allocLookup(src);
for (Node element : targets) {
if (element.makeP2Set().add(src)) {
varNodeWorkList.add((VarNode) element);
ret = true;
}
}
return ret;
}
use of soot.jimple.spark.pag.AllocNode in project soot by Sable.
the class GeomPointsTo method reachingObjects.
// An extra query interfaces not provided by SPARK
public PointsToSet reachingObjects(AllocNode an, SootField f) {
AllocDotField adf = an.dot(f);
IVarAbstraction pn = consG.get(adf);
// No such pointer seen by SPARK
if (adf == null)
return EmptyPointsToSet.v();
// Not seen by geomPTA
if (pn == null)
return adf.getP2Set();
if (hasTransformed || adf.getP2Set() != EmptyPointsToSet.v())
return adf.getP2Set();
// We transform and cache the result for the next query
pn = pn.getRepresentative();
PointsToSetInternal ptSet = adf.makeP2Set();
for (AllocNode obj : pn.getRepresentative().get_all_points_to_objects()) {
ptSet.add(obj);
}
return ptSet;
}
Aggregations