public void analyzeFlatSetFieldNode(Set<Edge> dstedges, FieldDescriptor fld, FlatNode currentProgramPoint) {
-
for (Edge edge:dstedges) {
- TaintSet taintSet = edge.getTaints();
+ TaintSet taintSet = edge.getTaints();
Alloc affectedAlloc = edge.getDst();
- Effect effect = new Effect(affectedAlloc, Effect.write, fld);
+ Effect effect = new Effect(affectedAlloc, Effect.write, fld);
if (taintSet!=null)
for (Taint taint:taintSet.getTaints()) {
- add( taint, effect, currentProgramPoint );
+ add(taint, effect, currentProgramPoint );
}
}
}
if (srcvar!=null)
return "<"+srcvar+", "+dst+">";
else if (fd!=null)
- return "<"+src+", "+statuspredicate+", "+fd+", "+dst+">";
+ return "<"+src+", "+statuspredicate+", "+fd+", "+dst+ ">";
else
return "<"+src+", "+statuspredicate+", [], "+dst+">";
}
return taints;
}
+ public String taintString() {
+ if (taints==null)
+ return "";
+ else
+ return taints.toString();
+ }
+
public Edge changeTaintSet(TaintSet ts) {
Edge newe=copy();
newe.taints=ts;
if (e.srcvar!=tmp)
throw new Error(e.srcvar +" is not equal to "+tmp);
AllocNode n=e.dst;
- output.println("\t"+tmp.getSymbol()+"->"+n.getID()+";");
+ output.println("\t"+tmp.getSymbol()+"->"+n.getID()+"[label=\""+e.taintString()+"\"];");
}
}
}
String src=node.getID();
String dst=n.getID();
String field=e.fd!=null?e.fd.getSymbol():"[]";
- output.println("\t"+src+"->"+dst+"[label=\""+field+"\"];");
+ String taint=e.taints!=null?":"+e.taintString():"";
+ output.println("\t"+src+"->"+dst+"[label=\""+field+" "+taint+"\"];");
}
}
}
}
//DEBUG
- if (false) {
+ if (true) {
int debugindex=0;
for(Map.Entry<BBlock, Graph> e:bbgraphMap.entrySet()) {
Graph g=e.getValue();