From: jjenista Date: Thu, 11 Mar 2010 22:18:14 +0000 (+0000) Subject: bug fix yonghun found, return value's region may be a new node for caller context... X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=adf4a6c25946b7fd8f078177f7c214dbdb9277fe;p=IRC.git bug fix yonghun found, return value's region may be a new node for caller context, might have to a matching object for caller context --- diff --git a/Robust/src/Analysis/Disjoint/ReachGraph.java b/Robust/src/Analysis/Disjoint/ReachGraph.java index c80e4e94..283e0cd2 100644 --- a/Robust/src/Analysis/Disjoint/ReachGraph.java +++ b/Robust/src/Analysis/Disjoint/ReachGraph.java @@ -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(), diff --git a/Robust/src/Tests/disjoint/predicateTest2/makefile b/Robust/src/Tests/disjoint/predicateTest2/makefile index 7a4c6b09..628bc7d5 100644 --- a/Robust/src/Tests/disjoint/predicateTest2/makefile +++ b/Robust/src/Tests/disjoint/predicateTest2/makefile @@ -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= diff --git a/Robust/src/Tests/disjoint/predicateTest2/test.java b/Robust/src/Tests/disjoint/predicateTest2/test.java index 46b0cd30..ee4e9211 100644 --- a/Robust/src/Tests/disjoint/predicateTest2/test.java +++ b/Robust/src/Tests/disjoint/predicateTest2/test.java @@ -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(); } }