From a6718881d16e21fed3338f88421a279a873117b8 Mon Sep 17 00:00:00 2001 From: jjenista Date: Wed, 4 Mar 2009 00:50:30 +0000 Subject: [PATCH] change global sweep to shrink reachability sets rather than trash them --- Robust/src/Analysis/OwnershipAnalysis/OwnershipGraph.java | 8 ++++++-- Robust/src/Tests/OwnershipAnalysisTest/test05/test.java | 2 ++ 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/Robust/src/Analysis/OwnershipAnalysis/OwnershipGraph.java b/Robust/src/Analysis/OwnershipAnalysis/OwnershipGraph.java index 6af319cb..ce1a3866 100644 --- a/Robust/src/Analysis/OwnershipAnalysis/OwnershipGraph.java +++ b/Robust/src/Analysis/OwnershipAnalysis/OwnershipGraph.java @@ -2184,8 +2184,12 @@ public class OwnershipGraph { Iterator itrRes = hrn.iteratorToReferencers(); while( itrRes.hasNext() ) { ReferenceEdge edge = itrRes.next(); - if( edge.getBeta().containsWithZeroes( tts ) && - !edge.getBetaNew().contains( tts ) ) { + + if( (edge.getBeta().containsWithZeroes( tts ) || + edge.getBeta().containsSuperSet ( tts ) + ) && + !edge.getBetaNew().contains( tts ) ) { + // okay, this is a valid propagation, and add to the // work set to further propagate it edge.setBetaNew( edge.getBetaNew().union( tts ) ); diff --git a/Robust/src/Tests/OwnershipAnalysisTest/test05/test.java b/Robust/src/Tests/OwnershipAnalysisTest/test05/test.java index b1fc0d65..a99a20b4 100644 --- a/Robust/src/Tests/OwnershipAnalysisTest/test05/test.java +++ b/Robust/src/Tests/OwnershipAnalysisTest/test05/test.java @@ -25,6 +25,7 @@ public class Test { X z; Y y; Y a; + X b = new X(); Y g = new Y(); x=disjoint X new X(); @@ -32,6 +33,7 @@ public class Test { x.f=y; z=x; a=z.f; + b.f=a; x.f=g; } } -- 2.34.1