fix.
[IRC.git] / Robust / src / Analysis / SSJava / FlowDownCheck.java
index 01d60c2c0966858491e1405dc5ae966c8dc950b3..86766e40154db8e3b2f6f76676a651c7765044c2 100644 (file)
@@ -6,6 +6,7 @@ import java.util.Comparator;
 import java.util.HashSet;
 import java.util.Hashtable;
 import java.util.Iterator;
+import java.util.LinkedList;
 import java.util.List;
 import java.util.Set;
 import java.util.StringTokenizer;
@@ -607,7 +608,13 @@ public class FlowDownCheck {
       // check 'for loop' case
       BlockNode bn = ln.getInitializer();
       bn.getVarTable().setParent(nametable);
-
+      // need to check initialization node
+//      checkLocationFromBlockNode(md, bn.getVarTable(), bn, constraint);
+      for(int i=0; i<bn.size(); i++) {
+        BlockStatementNode bsn=bn.get(i);
+        checkLocationFromBlockStatementNode(md, bn.getVarTable(),bsn, constraint);
+      }
+      
       // calculate glb location of condition and update statements
       CompositeLocation condLoc =
           checkLocationFromExpressionNode(md, bn.getVarTable(), ln.getCondition(),
@@ -730,11 +737,12 @@ public class FlowDownCheck {
 
   private void checkDeclarationInSubBlockNode(MethodDescriptor md, SymbolTable nametable,
       SubBlockNode sbn) {
-    checkDeclarationInBlockNode(md, nametable.getParent(), sbn.getBlockNode());
+    checkDeclarationInBlockNode(md, nametable, sbn.getBlockNode());
   }
 
   private CompositeLocation checkLocationFromBlockExpressionNode(MethodDescriptor md,
       SymbolTable nametable, BlockExpressionNode ben, CompositeLocation constraint) {
+
     CompositeLocation compLoc =
         checkLocationFromExpressionNode(md, nametable, ben.getExpression(), null, constraint, false);
     // addTypeLocation(ben.getExpression().getType(), compLoc);