Bug fix where two isolated heap regions with empty reachability sets have
authorjjenista <jjenista>
Wed, 24 Sep 2008 22:49:38 +0000 (22:49 +0000)
committerjjenista <jjenista>
Wed, 24 Sep 2008 22:49:38 +0000 (22:49 +0000)
a reference edge created between them.  Actually, the reachability sets
arent' empty, they contain the empty token tuple set, but the edge that
gets created has the empty reachability set.  Changed the field set method
to detect this and fill it in.  This is not a good fix, find the reason
why it happens in the first place.

Robust/src/Analysis/OwnershipAnalysis/OwnershipGraph.java
Robust/src/Tests/OwnershipAnalysisTest/test01/test01.java

index a3a65298f549ed3d7e5c3c5059461d7c93f73fa1..50b4a515391c249080a86e3fb3696d0237553ffc 100644 (file)
@@ -433,6 +433,7 @@ public class OwnershipGraph {
        // then propagate back just up the edges from hrn
        ChangeTupleSet Cx = R.unionUpArityToChangeSet(O);
 
+
        HashSet<ReferenceEdge> todoEdges = new HashSet<ReferenceEdge>();
 
        Hashtable<ReferenceEdge, ChangeTupleSet> edgePlannedChanges =
@@ -450,8 +451,19 @@ public class OwnershipGraph {
                                 edgesWithNewBeta);
 
 
+       if( edgeY.getBetaNew().equals( new ReachabilitySet() ) ) {
+         edgeY.setBetaNew( new ReachabilitySet( new TokenTupleSet().makeCanonical() ).makeCanonical() );
+       }
 
-       //System.out.println( edgeY.getBetaNew() + "\nbeing pruned by\n" + hrnX.getAlpha() );
+       /*
+       System.out.println( "---------------------------\n" +
+                           edgeY.getBetaNew() + 
+                           "\nbeing pruned by\n" + 
+                           hrnX.getAlpha() + 
+                           "\nis\n" + 
+                           edgeY.getBetaNew().pruneBy(hrnX.getAlpha())
+                           );
+       */
 
        // create the actual reference edge hrnX.f -> hrnY
        ReferenceEdge edgeNew = new ReferenceEdge(hrnX,
index ee94e76ac984018e998797778f9e943ecbe3a4fe..77510319076c93dc45d50d32db42ea954f5b350c 100644 (file)
@@ -3,17 +3,32 @@ public class Parameter {
   flag w;
   int a;
   int b;
-  Parameter f;
-  Parameter g;
-  Penguin p;
-  Foo h;
+  //Parameter f;
+  //Parameter g;
+  //Penguin p;
+  //Foo h;
   
-  public Parameter() { a = 0; b = 0; f = null; g = null; }
+  public Parameter() {} // a = 0; b = 0; f = null; g = null; }
   
-  public void bar() { foo(); }
-  public void foo() { bar(); }
+  //public void bar() { foo(); }
+  //public void foo() { bar(); }
+
+  static public void proof( Fooz p0, Fooz p1 ) {
+    Fooz c = new Fooz();
+    Fooz d = new Fooz();
+
+    c.x  = d;
+    p0.x = c;
+    p1.x = d;
+  }
+}
+
+public class Fooz {
+  public Fooz() {}
+  public Fooz x;
 }
 
+/*
 public class Penguin {
   int x;
   int y;
@@ -95,7 +110,6 @@ public class Foo {
     p0.x = g1;
   }
 
-  /*
   static public void m2_( Foo p0 ) {
     Foo g0 = new Foo();
     
@@ -166,9 +180,8 @@ public class Foo {
     p0.y = p1;
     p1.y = p0;
   }
-  */
 }
-
+*/
 
 
 // this empty task should still create a non-empty
@@ -177,18 +190,20 @@ public class Foo {
 // a heap region that is multi-object, flagged, not summary
 task Startup( StartupObject s{ initialstate } ) {
 
-  Parameter p0 = new Parameter();
+  //Parameter p0 = new Parameter();
 
   //int a, b, c;
 
+  Parameter.proof( null, null );
 
+  /*
   int a = 1;
   int b = 2;
   int c = 3;
 
   b = c;
   a = b;
-
+  */
 
   taskexit( s{ !initialstate } );
 }
@@ -458,6 +473,7 @@ task getNewFromMethod( Foo p0{ f } ) {
 }
 */
 
+/*
 task methodTest01_( Foo p0{ f }, Foo p1{ f } ) {
 
   Foo a0before = new Foo();
@@ -479,7 +495,7 @@ task methodTest01_( Foo p0{ f }, Foo p1{ f } ) {
 
   taskexit( p0{ !f }, p1{ !f } );
 }
-
+*/
 
 /*
 task methodTest02_( Foo p0{ f }, Foo p1{ f } ) {