bug fix yonghun found, return value's region may be a new node for caller context...
authorjjenista <jjenista>
Thu, 11 Mar 2010 22:18:14 +0000 (22:18 +0000)
committerjjenista <jjenista>
Thu, 11 Mar 2010 22:18:14 +0000 (22:18 +0000)
Robust/src/Analysis/Disjoint/ReachGraph.java
Robust/src/Tests/disjoint/predicateTest2/makefile
Robust/src/Tests/disjoint/predicateTest2/test.java

index c80e4e9457c323e60806dba82ad9f1919bf3dc21..283e0cd21433da8adbd1f64c1432c59031c84359 100644 (file)
@@ -1985,7 +1985,23 @@ public class ReachGraph {
         Integer hrnIDDstShadow = asDst.getShadowIDfromID( hrnDstCallee.getID() );
 
         HeapRegionNode hrnDstCaller = id2hrn.get( hrnIDDstShadow );
-        assert hrnDstCaller != null;
+        if( hrnDstCaller == null ) {
+          hrnDstCaller =
+            createNewHeapRegionNode( hrnIDDstShadow,                // id or null to generate a new one 
+                                     hrnDstCallee.isSingleObject(), // single object?           
+                                     hrnDstCallee.isNewSummary(),   // summary?         
+                                     hrnDstCallee.isFlagged(),      // flagged?
+                                     false,                      // out-of-context?
+                                     hrnDstCallee.getType(),        // type                             
+                                     hrnDstCallee.getAllocSite(),   // allocation site                  
+                                     hrnDstCallee.getInherent(),    // inherent reach
+                                     null,                       // current reach                 
+                                     predsTrue,                 // predicates
+                                     hrnDstCallee.getDescription()  // description
+                                     );                                        
+        } else {
+          assert hrnDstCaller.isWiped();
+        }
 
         TypeDescriptor tdNewEdge =
           mostSpecificType( reCallee.getType(),
index 7a4c6b095ab13f9f39cd41e26f37cea1a7b7d033..628bc7d514cdd08fb9bdc8da763ec48117ab9341 100644 (file)
@@ -5,11 +5,11 @@ 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 addBar addSomething 1
 #DEBUGFLAGS= -disjoint-debug-callsite Bar addBar 1
 #DEBUGFLAGS=
 
index 46b0cd302ce9602d5b9a7d90fa6adc0d5a92e0e7..ee4e9211fb88906d0bbd43c6d9e92a48007d49bd 100644 (file)
@@ -1,5 +1,6 @@
 public class Foo {
   public Foo() {}
+  public Foo f;
   public Bar b;
 }
 
@@ -17,17 +18,27 @@ public class Test {
     
     Foo f2 = new Foo();
     addSomething( f2 );    
+
+    Foo f3 = getAFoo();
+    Foo f4 = getAFoo();
+    f3.f = f4;
   }   
 
   public static void addSomething( Foo f ) {
-    addBar( f );
+    //addBar( f );
   }
 
   public static void addBar( Foo g ) {
+    /*
     if( true ) {
       g.b = new Bar();
     } else {
       g.b = new Bar();
     }
+    */
+  }
+
+  public static Foo getAFoo() {
+    return new Foo();
   }
 }