From: jjenista Date: Wed, 17 Mar 2010 15:01:14 +0000 (+0000) Subject: working on reach prop, pred bugs, basic tests still do not work, gotta squash more... X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=10e693f0092377ef775134dfb5881bebb8be5579;p=IRC.git working on reach prop, pred bugs, basic tests still do not work, gotta squash more bugs --- diff --git a/Robust/src/Analysis/Disjoint/ReachGraph.java b/Robust/src/Analysis/Disjoint/ReachGraph.java index e5415018..f2dcff2a 100644 --- a/Robust/src/Analysis/Disjoint/ReachGraph.java +++ b/Robust/src/Analysis/Disjoint/ReachGraph.java @@ -2281,7 +2281,6 @@ public class ReachGraph { while( rsnItr.hasNext() ) { RefSrcNode rsnCaller = rsnItr.next(); - // TODO: beta rewrites RefEdge reCaller = new RefEdge( rsnCaller, hrnDstCaller, reCallee.getType(), @@ -2298,8 +2297,17 @@ public class ReachGraph { ExistPredSet preds2 = state.getPreds(); assert preds2.preds.size() == 1; + if( state.isEmpty() ) { + continue; + } + ExistPred pred = preds2.preds.iterator().next(); ReachState old = pred.ne_state; + + if( old == null ) { + old = rstateEmpty; + } + assert old != null; cs = Canonical.union( cs, @@ -2328,20 +2336,24 @@ public class ReachGraph { ); // for reach propagation - edgePlannedChanges.put( - edgeExisting, - Canonical.union( edgePlannedChanges.get( edgeExisting ), - cs - ) - ); + if( !cs.isEmpty() ) { + edgePlannedChanges.put( + edgeExisting, + Canonical.union( edgePlannedChanges.get( edgeExisting ), + cs + ) + ); + } } else { addRefEdge( rsnCaller, hrnDstCaller, reCaller ); // for reach propagation - edgesForPropagation.add( reCaller ); - assert !edgePlannedChanges.containsKey( reCaller ); - edgePlannedChanges.put( reCaller, cs ); + if( !cs.isEmpty() ) { + edgesForPropagation.add( reCaller ); + assert !edgePlannedChanges.containsKey( reCaller ); + edgePlannedChanges.put( reCaller, cs ); + } } } } @@ -3195,13 +3207,10 @@ public class ReachGraph { ) ); - // if hrnB is already dirty or hrnA is dirty, - // the hrnB should end up dirty: TODO - /* - if( !hrnA.isClean() ) { - hrnB.setIsClean( false ); - } - */ + hrnB.setPreds( Canonical.join( hrnB.getPreds(), + hrnA.getPreds() + ) + ); } } @@ -3279,12 +3288,11 @@ public class ReachGraph { edgeA.getBeta() ) ); - // TODO: what? - /* - if( !edgeA.isClean() ) { - edgeToMerge.setIsClean( false ); - } - */ + edgeToMerge.setPreds( + Canonical.join( edgeToMerge.getPreds(), + edgeA.getPreds() + ) + ); } } } @@ -3344,12 +3352,10 @@ public class ReachGraph { edgeA.getBeta() ) ); - // TODO: what? - /* - if( !edgeA.isClean() ) { - edgeToMerge.setIsClean( false ); - } - */ + edgeToMerge.setPreds( Canonical.join( edgeToMerge.getPreds(), + edgeA.getPreds() + ) + ); } } } diff --git a/Robust/src/Tests/disjoint/predicateTest3/makefile b/Robust/src/Tests/disjoint/predicateTest3/makefile index 7a4c6b09..b4cecea7 100644 --- a/Robust/src/Tests/disjoint/predicateTest3/makefile +++ b/Robust/src/Tests/disjoint/predicateTest3/makefile @@ -5,13 +5,13 @@ SOURCE_FILES=$(PROGRAM).java BUILDSCRIPT=~/research/Robust/src/buildscript #DEBUGFLAGS= -disjoint-debug-callsite Bar addSomething 1 -DEBUGFLAGS= -disjoint-debug-callsite Foo main 1 +#DEBUGFLAGS= -disjoint-debug-callsite Foo main 1 #DEBUGFLAGS= -disjoint-debug-callsite main analysisEntryMethod 1 #DEBUGFLAGS= -disjoint-debug-callsite addSomething main 1 #DEBUGFLAGS= -disjoint-debug-callsite addBar addSomething 1 #DEBUGFLAGS= -disjoint-debug-callsite Bar addBar 1 -#DEBUGFLAGS= +DEBUGFLAGS= BSFLAGS= -mainclass Test -justanalyze -disjoint -disjoint-k 2 -disjoint-write-dots final -disjoint-write-ihms -disjoint-alias-file aliases.txt normal -enable-assertions