dump-prase-tree.c (show_code_node): Set the current namespace to the BLOCK before...
authorThomas Koenig <tkoenig@gcc.gnu.org>
Sat, 30 Apr 2011 21:13:44 +0000 (21:13 +0000)
committerThomas Koenig <tkoenig@gcc.gnu.org>
Sat, 30 Apr 2011 21:13:44 +0000 (21:13 +0000)
2011-04-30  Thomas Koenig  <tkoenig@gcc.gnu.org>

* dump-prase-tree.c (show_code_node):  Set the current
namespace to the BLOCK before displaying it; restore
afterwards.

From-SVN: r173223

gcc/fortran/ChangeLog
gcc/fortran/dump-parse-tree.c

index 66f744aebce3439df01889fbc0a0af242af0b6e9..59a4d35d26f3a75690bdc8d304058af46ab7b396 100644 (file)
@@ -1,3 +1,9 @@
+2011-04-30  Thomas Koenig  <tkoenig@gcc.gnu.org>
+
+       * dump-prase-tree.c (show_code_node):  Set the current
+       namespace to the BLOCK before displaying it; restore
+       afterwards.
+
 2011-04-30  Tobias Burnus  <burnus@net-b.de>
 
        PR fortran/48821
index 424feb1e68e61c084c30150fcd241e06d07882eb..c6be074b21dc80b3ed9f40ed35b4a3a15bb8b04d 100644 (file)
@@ -1440,6 +1440,8 @@ show_code_node (int level, gfc_code *c)
     case EXEC_BLOCK:
       {
        const char* blocktype;
+       gfc_namespace *saved_ns;
+
        if (c->ext.block.assoc)
          blocktype = "ASSOCIATE";
        else
@@ -1448,7 +1450,10 @@ show_code_node (int level, gfc_code *c)
        fprintf (dumpfile, "%s ", blocktype);
        ++show_level;
        ns = c->ext.block.ns;
+       saved_ns = gfc_current_ns;
+       gfc_current_ns = ns;
        gfc_traverse_symtree (ns->sym_root, show_symtree);
+       gfc_current_ns = saved_ns;
        show_code (show_level, ns->code);
        --show_level;
        show_indent ();