couple of little bugs working in tandem to wreck reachability, looking much better now
authorjjenista <jjenista>
Thu, 18 Mar 2010 18:48:56 +0000 (18:48 +0000)
committerjjenista <jjenista>
Thu, 18 Mar 2010 18:48:56 +0000 (18:48 +0000)
Robust/src/Analysis/Disjoint/Canonical.java
Robust/src/Analysis/Disjoint/ReachGraph.java

index ff84dc284436ba8b0b5d5c4ee28576b1ff5f52ac..7918033fa22d19710f8fb431dedd2630aea9264f 100644 (file)
@@ -1114,20 +1114,34 @@ abstract public class Canonical {
                                        );
         }
 
+
       } else {
-        // otherwise the ith symbol becomes shadowed
-       Integer I = as.getAge( rt.getHrnID() );
-       assert I != null;
-        
+        // otherwise age is in range [0, k]
+        Integer I = as.getAge( rt.getHrnID() );
+        assert I != null;        
         assert !rt.isMultiObject();
+        assert rt.getArity() == ReachTuple.ARITY_ONE;
+
+        if( rt.isOutOfContext() ) {
+          // becomes the in-context version
+          baseState = Canonical.union( baseState,
+                                       ReachTuple.factory( rt.getHrnID(),
+                                                           false, // multi
+                                                           ReachTuple.ARITY_ONE,
+                                                           false  // out-of-context
+                                                           )
+                                       );          
 
-        baseState = Canonical.union( baseState,
-                                     ReachTuple.factory( -rt.getHrnID(),
-                                                         false, // multi
-                                                         rt.getArity(),
-                                                         false  // out-of-context
-                                                         )
-                                     );        
+        } else {
+          // otherwise the ith symbol becomes shadowed
+          baseState = Canonical.union( baseState,
+                                       ReachTuple.factory( -rt.getHrnID(),
+                                                           false, // multi
+                                                           ReachTuple.ARITY_ONE,
+                                                           false  // out-of-context
+                                                           )
+                                       );        
+        }
       }
     }
 
index 11b48e075c9970a3a0792926512b55e44cdbf7a4..72f42dbd05171587451425d88117d51c49ffce4c 100644 (file)
@@ -1427,8 +1427,8 @@ public class ReachGraph {
         Iterator<AllocSite> asItr = allocSites.iterator();
         while( asItr.hasNext() ) {
           AllocSite as = asItr.next();
-          rsCaller = Canonical.toCallerContext( rs, as );
-        }
+          rsCaller = Canonical.toCallerContext( rsCaller, as );
+        }     
         
         // then before adding each derived, now caller-context
         // states to the output, attach the appropriate pred
@@ -1444,8 +1444,8 @@ public class ReachGraph {
                                  );
         }
       }
-    }
-    
+    }    
+
     assert out.isCanonical();
     return out;
   }