Search in sources :

Example 21 with FieldRefNode

use of soot.jimple.spark.pag.FieldRefNode in project soot by Sable.

the class SootUtil method storesOnField.

public static FieldToEdgesMap storesOnField(PAG pag) {
    FieldToEdgesMap storesOnField = new FieldToEdgesMap();
    Iterator frNodeIter = pag.storeInvSourcesIterator();
    while (frNodeIter.hasNext()) {
        FieldRefNode frNode = (FieldRefNode) frNodeIter.next();
        VarNode source = frNode.getBase();
        SparkField field = frNode.getField();
        Node[] targets = pag.storeInvLookup(frNode);
        for (int i = 0; i < targets.length; i++) {
            VarNode target = (VarNode) targets[i];
            storesOnField.put(field, new Pair<VarNode, VarNode>(target, source));
        }
    }
    return storesOnField;
}
Also used : GlobalVarNode(soot.jimple.spark.pag.GlobalVarNode) LocalVarNode(soot.jimple.spark.pag.LocalVarNode) VarNode(soot.jimple.spark.pag.VarNode) FieldRefNode(soot.jimple.spark.pag.FieldRefNode) SparkField(soot.jimple.spark.pag.SparkField) FieldRefNode(soot.jimple.spark.pag.FieldRefNode) GlobalVarNode(soot.jimple.spark.pag.GlobalVarNode) StringConstantNode(soot.jimple.spark.pag.StringConstantNode) LocalVarNode(soot.jimple.spark.pag.LocalVarNode) Node(soot.jimple.spark.pag.Node) VarNode(soot.jimple.spark.pag.VarNode) AllocNode(soot.jimple.spark.pag.AllocNode) Iterator(java.util.Iterator)

Aggregations

FieldRefNode (soot.jimple.spark.pag.FieldRefNode)21 VarNode (soot.jimple.spark.pag.VarNode)21 AllocNode (soot.jimple.spark.pag.AllocNode)20 Node (soot.jimple.spark.pag.Node)20 PointsToSetInternal (soot.jimple.spark.sets.PointsToSetInternal)15 SparkField (soot.jimple.spark.pag.SparkField)14 LocalVarNode (soot.jimple.spark.pag.LocalVarNode)10 ClassConstantNode (soot.jimple.spark.pag.ClassConstantNode)8 GlobalVarNode (soot.jimple.spark.pag.GlobalVarNode)8 NewInstanceNode (soot.jimple.spark.pag.NewInstanceNode)8 HashSet (java.util.HashSet)6 AllocDotField (soot.jimple.spark.pag.AllocDotField)6 P2SetVisitor (soot.jimple.spark.sets.P2SetVisitor)6 RefType (soot.RefType)5 SootMethod (soot.SootMethod)5 Type (soot.Type)5 AssignEdge (soot.jimple.spark.ondemand.pautil.AssignEdge)5 Iterator (java.util.Iterator)3 ImmutableStack (soot.jimple.spark.ondemand.genericutil.ImmutableStack)3 Stack (soot.jimple.spark.ondemand.genericutil.Stack)3