use of soot.jimple.spark.pag.Node 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.Node 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.Node in project soot by Sable.
the class MergeChecker method handleStores.
protected void handleStores(final VarNode src) {
final PointsToSetInternal srcSet = src.getP2Set();
if (srcSet.isEmpty())
return;
Node[] storeTargets = pag.storeLookup(src);
for (Node element : storeTargets) {
final FieldRefNode fr = (FieldRefNode) element;
checkAll(fr, srcSet, src);
}
}
use of soot.jimple.spark.pag.Node in project soot by Sable.
the class GeomPointsTo method getMethodIDFromPtr.
/**
* Get the index of the enclosing function of the specified node.
*/
public int getMethodIDFromPtr(IVarAbstraction pn) {
SootMethod sm = null;
int ret = Constants.SUPER_MAIN;
Node node = pn.getWrappedNode();
if (node instanceof AllocNode) {
sm = ((AllocNode) node).getMethod();
} else if (node instanceof LocalVarNode) {
sm = ((LocalVarNode) node).getMethod();
} else if (node instanceof AllocDotField) {
sm = ((AllocDotField) node).getBase().getMethod();
}
if (sm != null && func2int.containsKey(sm)) {
int id = func2int.get(sm);
if (vis_cg[id] == 0)
ret = Constants.UNKNOWN_FUNCTION;
else
ret = id;
}
return ret;
}
use of soot.jimple.spark.pag.Node in project soot by Sable.
the class OfflineProcessor method defaultFeedPtsRoutines.
public void defaultFeedPtsRoutines() {
switch(Parameters.seedPts) {
case Constants.seedPts_allUser:
setAllUserCodeVariablesUseful();
break;
case Constants.seedPts_all:
// All pointers will be processed
for (int i = 0; i < n_var; ++i) {
IVarAbstraction pn = int2var.get(i);
if (pn != null && pn.getRepresentative() == pn)
pn.willUpdate = true;
}
return;
}
// We always refine the callsites that have multiple call targets
Set<Node> multiBaseptrs = new HashSet<Node>();
for (Stmt callsite : geomPTA.multiCallsites) {
InstanceInvokeExpr iie = (InstanceInvokeExpr) callsite.getInvokeExpr();
VarNode vn = geomPTA.findLocalVarNode(iie.getBase());
multiBaseptrs.add(vn);
}
addUserDefPts(multiBaseptrs);
}
Aggregations