Added missing code block in find_lexical_block
authorKetan Dixit <ketan.dixit@gmail.com>
Wed, 4 Aug 2010 20:53:10 +0000 (16:53 -0400)
committerJustin Seyster <jseyster@cs.sunysb.edu>
Fri, 13 Aug 2010 23:40:58 +0000 (19:40 -0400)
src/aop-pc-assign.c

index 0c8cdf21702e15ba1791ffd705b4c41d25207cc1..e73aa30716ad9da77834ae22d5e14f508832e726 100644 (file)
@@ -411,6 +411,7 @@ static bool
 find_lexical_block (tree lhs, tree block, int *indexp)
 {
   tree t;
+  tree subblock;
 
   /* Search locally */
   if (BLOCK_VARS (block))
@@ -418,7 +419,20 @@ find_lexical_block (tree lhs, tree block, int *indexp)
       if (lhs == t)
        return true;
 
-  if(BLOCK_CHAIN (block))
+  if (BLOCK_SUBBLOCKS (block))
+    {
+      for (subblock = BLOCK_SUBBLOCKS (block); subblock;
+          subblock = BLOCK_CHAIN (block))
+       {
+         (*indexp)++;
+         bool found = false;
+         found = find_lexical_block (lhs, subblock, indexp);
+         if (found)
+           return true;
+       }
+    }
+
+  if (BLOCK_CHAIN (block))
     {
       for (t = BLOCK_CHAIN (block); t; t = BLOCK_CHAIN(block))
        {