From 64ff3ab603aa7cf5362e78b94e2bbefdb8872600 Mon Sep 17 00:00:00 2001 From: jjenista Date: Thu, 18 Mar 2010 18:48:56 +0000 Subject: [PATCH] couple of little bugs working in tandem to wreck reachability, looking much better now --- Robust/src/Analysis/Disjoint/Canonical.java | 36 ++++++++++++++------ Robust/src/Analysis/Disjoint/ReachGraph.java | 8 ++--- 2 files changed, 29 insertions(+), 15 deletions(-) diff --git a/Robust/src/Analysis/Disjoint/Canonical.java b/Robust/src/Analysis/Disjoint/Canonical.java index ff84dc28..7918033f 100644 --- a/Robust/src/Analysis/Disjoint/Canonical.java +++ b/Robust/src/Analysis/Disjoint/Canonical.java @@ -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 + ) + ); + } } } diff --git a/Robust/src/Analysis/Disjoint/ReachGraph.java b/Robust/src/Analysis/Disjoint/ReachGraph.java index 11b48e07..72f42dbd 100644 --- a/Robust/src/Analysis/Disjoint/ReachGraph.java +++ b/Robust/src/Analysis/Disjoint/ReachGraph.java @@ -1427,8 +1427,8 @@ public class ReachGraph { Iterator 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; } -- 2.34.1