}
- public static Taint makePredsTrue( Taint t ) {
+ public static Taint changePredsTo( Taint t, ExistPredSet preds ) {
assert t != null;
assert t.isCanonical();
// the empty reach state as the second, it's never used,
// but makes the hashing happy
CanonicalOp op =
- new CanonicalOp( CanonicalOp.TAINT_MAKEPREDSTRUE,
+ new CanonicalOp( CanonicalOp.TAINT_CHANGEPREDSTO,
t,
t );
t.stallSite,
t.var,
t.allocSite,
- ExistPredSet.factory( ExistPred.factory() )
+ preds
);
out = (Taint) makeCanonical( out );
}
- public static TaintSet makePredsTrue( TaintSet ts ) {
+ public static TaintSet changePredsTo( TaintSet ts, ExistPredSet preds ) {
assert ts != null;
assert ts.isCanonical();
// the empty reach set as the second, it's never used,
// but makes the hashing happy
CanonicalOp op =
- new CanonicalOp( CanonicalOp.TAINTSET_MAKEPREDSTRUE,
+ new CanonicalOp( CanonicalOp.TAINTSET_CHANGEPREDSTO,
ts,
- TaintSet.factory() );
+ ts );
Canonical result = op2result.get( op );
if( result != null ) {
while( itr.hasNext() ) {
Taint t = itr.next();
out = Canonical.add( out,
- Canonical.makePredsTrue( t )
+ Canonical.changePredsTo( t, preds )
);
}
public static final int TAINTSET_ADD_TAINT = 0xcd17;
public static final int TAINTSET_UNION_TAINTSET = 0xa835;
public static final int TAINTSET_UNIONORPREDS_TAINTSET = 0x204f;
- public static final int TAINT_MAKEPREDSTRUE = 0x3ab4;
- public static final int TAINTSET_MAKEPREDSTRUE = 0x2ff1;
+ public static final int TAINT_CHANGEPREDSTO = 0x3ab4;
+ public static final int TAINTSET_CHANGEPREDSTO = 0x2ff1;
protected int opCode;
protected Canonical operand1;
if( doEffectsAnalysis && fmContaining != fmAnalysisEntry ) {
FlatSESEEnterNode seseContaining =
rblockRel.getRBlockStacks( fmContaining, fn ).peek();
-
+
effectsAnalysis.analyzeFlatFieldNode( fmContaining,
seseContaining,
rg, rhs, fld );
);
if( doEffectsAnalysis && fmContaining != fmAnalysisEntry ) {
-
+
FlatSESEEnterNode seseContaining =
rblockRel.getRBlockStacks( fmContaining, fn ).peek();
ReachGraph rg, TempDescriptor rhs, FieldDescriptor fld) {
VariableNode vn = rg.td2vn.get(rhs);
-
+ if( vn == null ) {
+ return;
+ }
+
for (Iterator<RefEdge> iterator = vn.iteratorToReferencees(); iterator.hasNext();) {
RefEdge edge = iterator.next();
TaintSet taintSet = edge.getTaints();
ReachGraph rg, TempDescriptor lhs, FieldDescriptor fld, boolean strongUpdate) {
VariableNode vn = rg.td2vn.get(lhs);
+ if( vn == null ) {
+ return;
+ }
for (Iterator<RefEdge> iterator = vn.iteratorToReferencees(); iterator.hasNext();) {
RefEdge edge = iterator.next();
public void analyzeFlatCall(FlatMethod fmContaining, FlatSESEEnterNode seseContaining,
FlatMethod fmCallee, Hashtable<Taint, TaintSet> tCallee2tsCaller) {
-
- EffectSet esCaller = getEffectSet(fmContaining);
- if( esCaller == null ) {
- esCaller = new EffectSet();
- }
-
+
EffectSet esCallee = getEffectSet(fmCallee);
if( esCallee == null ) {
esCallee = new EffectSet();
Iterator<Taint> tItr = tCallee2tsCaller.get( tCallee ).iterator();
while( tItr.hasNext() ) {
Taint tCaller = tItr.next();
+
+ EffectSet esCaller = new EffectSet();
Iterator<Effect> eItr = effects.iterator();
while( eItr.hasNext() ) {
}
add( fmContaining, tCaller, esCaller );
- add( seseContaining, tCaller, esCaller );
+ add( seseContaining, tCaller, esCaller );
}
}
}
protected TypeDescriptor e_type;
protected String e_field;
- // edge uses same ReachState ne_state as node type above
+
)
),
predsTrue,
- Canonical.makePredsTrue( edgeY.getTaints() )
+ Canonical.changePredsTo( edgeY.getTaints(),
+ predsTrue )
);
addEdgeOrMergeWithExisting( edgeNew );
HeapRegionNode referencee = edgeX.getDst();
RefEdge edgeNew = edgeX.copy();
edgeNew.setSrc( lnR );
- edgeNew.setTaints( Canonical.makePredsTrue( edgeNew.getTaints() ) );
+ edgeNew.setTaints( Canonical.changePredsTo( edgeNew.getTaints(),
+ predsTrue
+ )
+ );
addRefEdge( lnR, referencee, edgeNew );
}
Iterator<TempDescriptor> isvItr = sese.getInVarSet().iterator();
while( isvItr.hasNext() ) {
TempDescriptor isv = isvItr.next();
- VariableNode vn = td2vn.get( isv );
-
+ VariableNode vn = getVariableNodeFromTemp( isv );
+
Iterator<RefEdge> reItr = vn.iteratorToReferencees();
while( reItr.hasNext() ) {
RefEdge re = reItr.next();
ExistPredSet preds
) {
- VariableNode vn = td2vn.get( td );
+ VariableNode vn = getVariableNodeFromTemp( td );
Iterator<RefEdge> reItr = vn.iteratorToReferencees();
while( reItr.hasNext() ) {
oocHrnIdOoc2callee
),
preds,
- TaintSet.factory() // no taints
+ Canonical.changePredsTo( reCaller.getTaints(),
+ preds )
)
);
calleeEdge2calleeTaintsSatisfied.put( reCallee, calleeTaintsSatisfied );
}
- calleeTaintsSatisfied.put( tCallee, predsIfSatis );
+ calleeTaintsSatisfied.put( tCallee, predsIfSatis );
}
}
}
BUILDSCRIPT=~/research/Robust/src/buildscript
BSFLAGS= -mainclass Test -justanalyze -ooojava -disjoint -disjoint-k 1 -enable-assertions
-#DEBUGFLAGS= -disjoint-write-dots final -disjoint-write-initial-contexts -disjoint-write-ihms -disjoint-debug-snap-method main 0 10 true
+DEBUGFLAGS= -disjoint-write-dots final -disjoint-write-initial-contexts -disjoint-write-ihms # -disjoint-debug-snap-method main 0 10 true
all: $(PROGRAM).bin
*/
rblock r1 {
- a.f = new Foo();
- b.f = new Foo();
-
doSomething( a, b );
}
}
static void doSomething( Foo a, Foo b ) {
+
+ Foo x = b;
+ a.g = x;
- a.g = new Foo();
-
- a.f.f = a.g;
+ a.f = new Foo();
+ b.f = new Foo();
- Foo f = doStuff( a, b );
+ Foo f = doStuff( a.f, b.f );
}
static Foo doStuff( Foo m, Foo n ) {
- m.f.g = n.f;
+ m.g = n;
return new Foo();
}