//op2result.put( op, out ); CRY CRY
return out;
}
+
+
+ public static Taint makePredsTrue( Taint t ) {
+ assert t != null;
+ assert t.isCanonical();
+
+ // ops require two canonicals, in this case always supply
+ // the empty reach state as the second, it's never used,
+ // but makes the hashing happy
+ CanonicalOp op =
+ new CanonicalOp( CanonicalOp.TAINT_MAKEPREDSTRUE,
+ t,
+ t );
+
+ Canonical result = op2result.get( op );
+ if( result != null ) {
+ return (Taint) result;
+ }
+
+ // otherwise, no cached result...
+ Taint out = new Taint( t.sese,
+ t.stallSite,
+ t.var,
+ t.allocSite,
+ ExistPredSet.factory( ExistPred.factory() )
+ );
+
+ out = (Taint) makeCanonical( out );
+ op2result.put( op, out );
+ return out;
+ }
+
+
+ public static TaintSet makePredsTrue( TaintSet ts ) {
+ assert ts != null;
+ assert ts.isCanonical();
+
+ // ops require two canonicals, in this case always supply
+ // the empty reach set as the second, it's never used,
+ // but makes the hashing happy
+ CanonicalOp op =
+ new CanonicalOp( CanonicalOp.TAINTSET_MAKEPREDSTRUE,
+ ts,
+ TaintSet.factory() );
+
+ Canonical result = op2result.get( op );
+ if( result != null ) {
+ return (TaintSet) result;
+ }
+
+ // otherwise, no cached result...
+ TaintSet out = TaintSet.factory();
+ Iterator<Taint> itr = ts.iterator();
+ while( itr.hasNext() ) {
+ Taint t = itr.next();
+ out = Canonical.add( out,
+ Canonical.makePredsTrue( t )
+ );
+ }
+
+ out = (TaintSet) makeCanonical( out );
+ op2result.put( op, out );
+ return out;
+ }
}
)
),
predsTrue,
- edgeY.getTaints()
+ Canonical.makePredsTrue( edgeY.getTaints() )
);
addEdgeOrMergeWithExisting( edgeNew );
HeapRegionNode referencee = edgeX.getDst();
RefEdge edgeNew = edgeX.copy();
edgeNew.setSrc( lnR );
+ edgeNew.setTaints( Canonical.makePredsTrue( edgeNew.getTaints() ) );
addRefEdge( lnR, referencee, edgeNew );
}
static public void main( String[] args ) {
Foo a = new Foo();
+ Foo b = new Foo();
+ /*
if( false ) {
a = new Foo();
}
+ */
rblock r1 {
a.f = new Foo();
- doSomething( a );
+
+ b.f = new Foo();
+
+ doSomething( a, b );
}
}
- static void doSomething( Foo a ) {
+ static void doSomething( Foo a, Foo b ) {
a.g = new Foo();
a.f.f = a.g;
- //Foo x = a.g;
-
- // Foo y = new Foo();
- // y.f = x;
-
- //Foo f = doStuff( a, c );
+ Foo f = doStuff( a, b );
}
static Foo doStuff( Foo m, Foo n ) {
+ m.f.g = n.f;
+
return new Foo();
}
}