From c558e411df7e495d3b5674fdae125227efcdae9a Mon Sep 17 00:00:00 2001 From: yeom Date: Thu, 5 Aug 2010 20:27:12 +0000 Subject: [PATCH] fixes on FlatWriteDynamicVarNode to handle properly branch node. --- .../src/IR/Flat/FlatWriteDynamicVarNode.java | 25 ++++++++++++++++--- 1 file changed, 21 insertions(+), 4 deletions(-) diff --git a/Robust/src/IR/Flat/FlatWriteDynamicVarNode.java b/Robust/src/IR/Flat/FlatWriteDynamicVarNode.java index 552b845b..2f2119ea 100644 --- a/Robust/src/IR/Flat/FlatWriteDynamicVarNode.java +++ b/Robust/src/IR/Flat/FlatWriteDynamicVarNode.java @@ -30,11 +30,28 @@ public class FlatWriteDynamicVarNode extends FlatNode { } public void spliceIntoIR() { - tailNode.removeNext( headNode ); - headNode.removePrev( tailNode ); - tailNode.addNext( this ); - this.addNext( headNode ); + if(tailNode instanceof FlatCondBranch){ + + headNode.removePrev( tailNode ); + + if(tailNode.next.elementAt(0).equals(headNode)){ + tailNode.removeNext( headNode ); + ((FlatCondBranch)tailNode).addTrueNext(this); + }else{ + tailNode.removeNext( headNode ); + ((FlatCondBranch)tailNode).addFalseNext(this); + } + + this.addNext( headNode ); + }else{ + tailNode.removeNext( headNode ); + headNode.removePrev( tailNode ); + + tailNode.addNext( this ); + this.addNext( headNode ); + } + } public void addMoreVar2Src( Hashtable more ) { -- 2.34.1