return out;
}
+ public static TaintSet removeStallSiteTaints( TaintSet ts ) {
+ assert ts != null;
+ assert ts.isCanonical();
+
+ CanonicalOp op =
+ new CanonicalOp( CanonicalOp.TAINTSET_REMOVESTALLSITETAINTS,
+ ts,
+ ts );
+
+ Canonical result = op2result.get( op );
+ if( result != null ) {
+ return (TaintSet) result;
+ }
+
+ // otherwise, no cached result...
+ TaintSet out = new TaintSet();
+
+ Iterator<Taint> tItr = ts.iterator();
+ while( tItr.hasNext() ) {
+ Taint t = tItr.next();
+
+ // only take non-stall site taints onward
+ if( t.getStallSite() == null ) {
+ out.taints.add( t );
+ }
+ }
+
+ out = (TaintSet) makeCanonical( out );
+ op2result.put( op, out );
+ return out;
+ }
+
public static Taint changePredsTo( Taint t,
ExistPredSet preds ) {
public static final int TAINTSET_UNIONORPREDS_TAINTSET = 0x204f;
public static final int TAINT_CHANGEPREDSTO_EXISTPREDSET = 0x3ab4;
public static final int TAINTSET_CHANGEPREDSTO_EXISTPREDSET = 0x2ff1;
+ public static final int TAINTSET_REMOVESTALLSITETAINTS = 0xb69c;
protected int opCode;
protected Canonical operand1;
case FKind.FlatSESEEnterNode:
if( doEffectsAnalysis && fmContaining != fmAnalysisEntry ) {
+
+ // always remove ALL stall site taints at enter
+ rg.removeAllStallSiteTaints();
+
+ // inject taints for in-set vars
FlatSESEEnterNode sese = (FlatSESEEnterNode) fn;
rg.taintInSetVars( sese );
}
case FKind.FlatSESEExitNode:
if( doEffectsAnalysis && fmContaining != fmAnalysisEntry ) {
+
+ // always remove ALL stall site taints at exit
+ rg.removeAllStallSiteTaints();
+
+ // remove in-set vars for the exiting rblock
FlatSESEExitNode fsexn = (FlatSESEExitNode) fn;
rg.removeInContextTaints( fsexn.getFlatEnter() );
+
// sese exit clears all mappings of accessible vars and stall sites
// need to wipe out stall site taints
rg.clearAccessibleVarSet();
public void taintStallSite( FlatNode stallSite,
TempDescriptor var ) {
- System.out.println( "Tainting stall site: "+stallSite+" and "+var );
-
// stall site taint should propagate back into callers
// so give it TRUE predicates
taintTemp( null,
}
}
+ public void removeAllStallSiteTaints() {
+
+ Iterator meItr = id2hrn.entrySet().iterator();
+ while( meItr.hasNext() ) {
+ Map.Entry me = (Map.Entry) meItr.next();
+ Integer id = (Integer) me.getKey();
+ HeapRegionNode hrn = (HeapRegionNode) me.getValue();
+
+ Iterator<RefEdge> reItr = hrn.iteratorToReferencers();
+ while( reItr.hasNext() ) {
+ RefEdge re = reItr.next();
+
+ re.setTaints( Canonical.removeStallSiteTaints( re.getTaints()
+ )
+ );
+ }
+ }
+ }
+
// used in makeCalleeView below to decide if there is
// already an appropriate out-of-context edge in a callee
Foo x = a.f;
- x.g = new Foo();
+ doSomething( a, b );
+
+ //rblock c2 {
+ // b.f = new Foo();
+ //}
+
+ //x.g = new Foo();
}
Foo x = b;
a.g = x;
- a.f = new Foo();
- b.f = new Foo();
+ rblock j {
+ a.f = new Foo();
+ b.f = new Foo();
+ }
- Foo f = doStuff( a.f, b.f );
+ //Foo f = doStuff( a.f, b.f );
}
static Foo doStuff( Foo m, Foo n ) {