aboutsummaryrefslogtreecommitdiff
path: root/gcc/fortran/dump-parse-tree.c
diff options
context:
space:
mode:
authorThomas Koenig <tkoenig@gcc.gnu.org>2011-04-30 21:13:44 +0000
committerThomas Koenig <tkoenig@gcc.gnu.org>2011-04-30 21:13:44 +0000
commit03cf98376663dd12764cd0b67e8db2ad1dbaccc1 (patch)
tree20d42b10c628e4764e8d0bfee93854e0227c3349 /gcc/fortran/dump-parse-tree.c
parent2c7a09d774a2af28c51224404ba47f5f7c182cea (diff)
downloadgcc-03cf98376663dd12764cd0b67e8db2ad1dbaccc1.zip
gcc-03cf98376663dd12764cd0b67e8db2ad1dbaccc1.tar.gz
gcc-03cf98376663dd12764cd0b67e8db2ad1dbaccc1.tar.bz2
dump-prase-tree.c (show_code_node): Set the current namespace to the BLOCK before displaying it; restore afterwards.
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
Diffstat (limited to 'gcc/fortran/dump-parse-tree.c')
-rw-r--r--gcc/fortran/dump-parse-tree.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/gcc/fortran/dump-parse-tree.c b/gcc/fortran/dump-parse-tree.c
index 424feb1..c6be074 100644
--- a/gcc/fortran/dump-parse-tree.c
+++ b/gcc/fortran/dump-parse-tree.c
@@ -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 ();