use of soot.jimple.spark.pag.Node in project soot by Sable.
the class PropAlias 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)) {
addToWorklist((VarNode) element);
ret = true;
}
}
return ret;
}
use of soot.jimple.spark.pag.Node in project soot by Sable.
the class PropIter method handleStores.
protected final boolean handleStores(VarNode src) {
boolean ret = false;
final PointsToSetInternal srcSet = src.getP2Set();
if (srcSet.isEmpty())
return false;
Node[] storeTargets = pag.storeLookup(src);
for (Node element : storeTargets) {
final FieldRefNode fr = (FieldRefNode) element;
final SparkField f = fr.getField();
ret = fr.getBase().getP2Set().forall(new P2SetVisitor() {
public final void visit(Node n) {
AllocDotField nDotF = pag.makeAllocDotField((AllocNode) n, f);
if (nDotF.makeP2Set().addAll(srcSet, null)) {
returnValue = true;
}
}
}) | ret;
}
return ret;
}
use of soot.jimple.spark.pag.Node 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.Node 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.Node in project soot by Sable.
the class PropIter method handleNewInstances.
protected final boolean handleNewInstances(final NewInstanceNode src) {
boolean ret = false;
final Node[] newInstances = pag.assignInstanceLookup(src);
for (final Node instance : newInstances) {
ret = src.getP2Set().forall(new P2SetVisitor() {
@Override
public void visit(Node n) {
if (n instanceof ClassConstantNode) {
ClassConstantNode ccn = (ClassConstantNode) n;
Type ccnType = ccn.getClassConstant().toSootType();
// If the referenced class has not been loaded, we do
// this now
SootClass targetClass = ((RefType) ccnType).getSootClass();
if (targetClass.resolvingLevel() == SootClass.DANGLING)
Scene.v().forceResolve(targetClass.getName(), SootClass.SIGNATURES);
instance.makeP2Set().add(pag.makeAllocNode(src.getValue(), ccnType, ccn.getMethod()));
}
}
});
}
return ret;
}
Aggregations