From: yeom Date: Mon, 5 Oct 2009 17:04:46 +0000 (+0000) Subject: bug fix X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=a1f8b251376f932593be25c1d6b81c2478c7bd66;p=IRC.git bug fix --- diff --git a/Robust/src/Analysis/MLP/VarSrcTokTable.java b/Robust/src/Analysis/MLP/VarSrcTokTable.java index f5ba5dd7..aca67477 100644 --- a/Robust/src/Analysis/MLP/VarSrcTokTable.java +++ b/Robust/src/Analysis/MLP/VarSrcTokTable.java @@ -390,18 +390,33 @@ public class VarSrcTokTable { if( childItr.hasNext() ) { FlatSESEEnterNode child = childItr.next(); + // set of VSTs for removal + HashSet removalSet=new HashSet(); + // set of VSTs for additon + HashSet additionSet=new HashSet(); + Iterator vstItr = get( child ).iterator(); while( vstItr.hasNext() ) { VariableSourceToken vst = vstItr.next(); - + removalSet.add(vst); + additionSet.add(new VariableSourceToken( vst.getRefVars(), + curr, + new Integer( 0 ), + vst.getAddrVar() + )); + } + + // remove( eah item in forremoval ) + vstItr = removalSet.iterator(); + while( vstItr.hasNext() ) { + VariableSourceToken vst = vstItr.next(); remove( vst ); - - add( new VariableSourceToken( vst.getRefVars(), - curr, - new Integer( 0 ), - vst.getAddrVar() - ) - ); + } + // add( each ite inm for additon _ + vstItr = additionSet.iterator(); + while( vstItr.hasNext() ) { + VariableSourceToken vst = vstItr.next(); + add( vst ); } }