use of soot.jimple.spark.pag.VarNode in project soot by Sable.
the class SootUtil method printNodeNumberMapping.
public static void printNodeNumberMapping(String fileName, PAG pag) {
try {
PrintWriter pw = new PrintWriter(new FileOutputStream(fileName));
for (Iterator iter = pag.getVarNodeNumberer().iterator(); iter.hasNext(); ) {
VarNode vn = (VarNode) iter.next();
pw.println(vn.getNumber() + "\t" + vn);
}
pw.close();
} catch (FileNotFoundException e) {
logger.error(e.getMessage(), e);
}
}
use of soot.jimple.spark.pag.VarNode in project soot by Sable.
the class SootUtil method buildStoreMap.
public static FieldAccessMap buildStoreMap(PAG pag) {
FieldAccessMap ret = new FieldAccessMap();
Iterator frNodeIter = pag.storeInvSourcesIterator();
while (frNodeIter.hasNext()) {
FieldRefNode frNode = (FieldRefNode) frNodeIter.next();
SparkField field = frNode.getField();
Node[] targets = pag.storeInvLookup(frNode);
for (int i = 0; i < targets.length; i++) {
VarNode target = (VarNode) targets[i];
if (target instanceof GlobalVarNode)
continue;
ret.put(field, new Pair<FieldRefNode, LocalVarNode>(frNode, (LocalVarNode) target));
}
}
return ret;
}
use of soot.jimple.spark.pag.VarNode in project soot by Sable.
the class SootUtil method loadsOnField.
public static FieldToEdgesMap loadsOnField(PAG pag) {
FieldToEdgesMap loadsOnField = new FieldToEdgesMap();
Iterator frNodeIter = pag.loadSourcesIterator();
while (frNodeIter.hasNext()) {
FieldRefNode frNode = (FieldRefNode) frNodeIter.next();
VarNode source = frNode.getBase();
SparkField field = frNode.getField();
Node[] targets = pag.loadLookup(frNode);
for (int i = 0; i < targets.length; i++) {
VarNode target = (VarNode) targets[i];
loadsOnField.put(field, new Pair<VarNode, VarNode>(target, source));
}
}
return loadsOnField;
}
use of soot.jimple.spark.pag.VarNode in project soot by Sable.
the class MergeChecker method handleSimples.
protected void handleSimples(VarNode src) {
PointsToSetInternal srcSet = src.getP2Set();
if (srcSet.isEmpty())
return;
final Node[] simpleTargets = pag.simpleLookup(src);
for (Node element : simpleTargets) {
checkAll(element, srcSet, src);
}
}
use of soot.jimple.spark.pag.VarNode 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;
}
Aggregations