From 01eff974ec83ea879147b179e7b34d93f4d22323 Mon Sep 17 00:00:00 2001 From: jjenista Date: Mon, 9 Mar 2009 18:03:29 +0000 Subject: [PATCH] A small example with allocated regions propagating through various method contexts and properly mapping into the top-level caller. Does not expose bug that appears in direct-to benchmark --- .../OwnershipAnalysisTest/test05/test.java | 64 +++++++------------ 1 file changed, 22 insertions(+), 42 deletions(-) diff --git a/Robust/src/Tests/OwnershipAnalysisTest/test05/test.java b/Robust/src/Tests/OwnershipAnalysisTest/test05/test.java index b18a5b7c..fb30fab3 100644 --- a/Robust/src/Tests/OwnershipAnalysisTest/test05/test.java +++ b/Robust/src/Tests/OwnershipAnalysisTest/test05/test.java @@ -1,24 +1,7 @@ -// x=disjoint "X" new X() -// y=disjoint "Y" new Y() -// x.f=y -// z=x -// a=z.f -// x.f=g -// -// What is B(a)? - - -public class X extends Y { - public Y f; - public X() {} -} - -public class Y { - public Y() {} -} public class Foo { public Foo f; + public Foo g; public Foo() {} } @@ -26,32 +9,29 @@ public class Foo { public class Test { static public void main( String[] args ) { - /* - X x; - X z; - Y y; - Y a; - X b = new X(); - Y g = new Y(); - - x=disjoint X new X(); - y=disjoint Y new Y(); - x.f=y; - z=x; - a=z.f; - b.f=a; - x.f=g; - */ - otherThing(); + Foo a = disjoint A new Foo(); + Foo b = disjoint B new Foo(); + Foo c = disjoint C new Foo(); + + Foo q = disjoint Q new Foo(); + + while( false ) { + york( a, b, c ); + a.g = q; + b.g = q; + } } - static public void otherThing() { - Foo a = disjoint a new Foo(); - Foo b = disjoint b new Foo(); - Foo c = disjoint c new Foo(); + static public void york( Foo p1, Foo p2, Foo p3 ) { + p3.f = new Foo(); - b.f = c; - a.f = c; - c = null; + carolina( p1 ); } + + static public void carolina( Foo p1 ) { + Foo z = disjoint Z new Foo(); + + p1.f = z; + } + } -- 2.34.1