return out;
}
+
+ public static TaintSet add( TaintSet ts,
+ Taint t ) {
+ assert ts != null;
+ assert t != null;
+ assert ts.isCanonical();
+ assert t.isCanonical();
+
+ CanonicalOp op =
+ new CanonicalOp( CanonicalOp.TAINTSET_ADD_TAINT,
+ ts,
+ t );
+
+ Canonical result = op2result.get( op );
+ if( result != null ) {
+ return (TaintSet) result;
+ }
+
+ // otherwise, no cached result...
+ TaintSet out = new TaintSet();
+ out.taints.addAll( ts.taints );
+ out.taints.add( t );
+
+ out = (TaintSet) makeCanonical( out );
+ op2result.put( op, out );
+ return out;
+ }
+
+ public static TaintSet union( TaintSet ts1,
+ TaintSet ts2 ) {
+ assert ts1 != null;
+ assert ts2 != null;
+ assert ts1.isCanonical();
+ assert ts2.isCanonical();
+
+ CanonicalOp op =
+ new CanonicalOp( CanonicalOp.TAINTSET_UNION_TAINTSET,
+ ts1,
+ ts2 );
+
+ Canonical result = op2result.get( op );
+ if( result != null ) {
+ return (TaintSet) result;
+ }
+
+ // otherwise, no cached result...
+ TaintSet out = new TaintSet();
+ out.taints.addAll( ts1.taints );
+ out.taints.addAll( ts2.taints );
+
+ out = (TaintSet) makeCanonical( out );
+ op2result.put( op, out );
+ return out;
+ }
+
}
public static final int REACHSTATE_UNSHADOW_ALLOCSITE = 0x08ef;
public static final int REACHSTATE_MAKEPREDSTRUE = 0x0b9c;
public static final int REACHSET_MAKEPREDSTRUE = 0xdead;
+ public static final int TAINTSET_ADD_TAINT = 0xcd17;
+ public static final int TAINTSET_UNION_TAINTSET = 0xa835;
protected int opCode;
referencer.removeReferencee( edge );
referencee.removeReferencer( edge );
+
+ // TODO
+
+// int oldTaint=edge.getTaintIdentifier();
+// if(referencer instanceof HeapRegionNode){
+// depropagateTaintIdentifier((HeapRegionNode)referencer,oldTaint,new HashSet<HeapRegionNode>());
+// }
+
+
}
protected void clearRefEdgesFrom( RefSrcNode referencer,
ExistPredSet preds =
ExistPredSet.factory( pred );
+ Taint paramTaint =
+ Taint.factory( index, paramCallee.toString() );
+
+ TaintSet paramTaints =
+ TaintSet.factory( paramTaint );
+
RefEdge reCallee =
new RefEdge( vnCallee,
hrnDstCallee,
oocHrnIdOoc2callee
),
preds,
- null, null
+ paramTaints,
+ null
);
rg.addRefEdge( vnCallee,
assert edgeToMerge != null;
edgeToMerge.setBeta(
Canonical.unionORpreds( edgeToMerge.getBeta(),
- edgeA.getBeta()
- )
+ edgeA.getBeta()
+ )
);
edgeToMerge.setPreds(
Canonical.join( edgeToMerge.getPreds(),
edgeA.getPreds()
)
);
+ edgeToMerge.setParamTaints(
+ Canonical.union( edgeToMerge.getParamTaints(),
+ edgeA.getParamTaints()
+ )
+ );
+ edgeToMerge.setRblockTaints(
+ Canonical.union( edgeToMerge.getRblockTaints(),
+ edgeA.getRblockTaints()
+ )
+ );
}
}
}
edgeA.getPreds()
)
);
+ edgeToMerge.setParamTaints(
+ Canonical.union( edgeToMerge.getParamTaints(),
+ edgeA.getParamTaints()
+ )
+ );
+ edgeToMerge.setRblockTaints(
+ Canonical.union( edgeToMerge.getRblockTaints(),
+ edgeA.getRblockTaints()
+ )
+ );
}
}
}
return paramTaints;
}
+ public void setParamTaints( TaintSet taints ) {
+ this.paramTaints = taints;
+ }
+
public TaintSet getRblockTaints() {
return rblockTaints;
}
+ public void setRblockTaints( TaintSet taints ) {
+ this.rblockTaints = taints;
+ }
+
public String toStringDOT( boolean hideReach,
static public void f0( Foo a, Foo b ) {
a.f = b;
- f1( b );
+ //f1( b );
}
static public void f1( Foo c ) {