aboutsummaryrefslogtreecommitdiff
path: root/gcc/tree.c
diff options
context:
space:
mode:
authorEric Botcazou <ebotcazou@adacore.com>2011-07-17 15:06:36 +0000
committerEric Botcazou <ebotcazou@gcc.gnu.org>2011-07-17 15:06:36 +0000
commit1ff247496641c78fbfbeb6a04db2c8dbdedbcf1f (patch)
tree7c6e299f25c884686c710a82475f43eda7b6e38e /gcc/tree.c
parent73cd74f8e7a9f2c7b6fe38c0b76179f89c363f37 (diff)
downloadgcc-1ff247496641c78fbfbeb6a04db2c8dbdedbcf1f.zip
gcc-1ff247496641c78fbfbeb6a04db2c8dbdedbcf1f.tar.gz
gcc-1ff247496641c78fbfbeb6a04db2c8dbdedbcf1f.tar.bz2
re PR middle-end/49732 (crash on terminal_interface-curses-menus.adb from ncurses with -gnato)
PR middle-end/49732 * tree.c (walk_tree_1) <DECL_EXPR>: Do not walk a pointed-to type. From-SVN: r176371
Diffstat (limited to 'gcc/tree.c')
-rw-r--r--gcc/tree.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/gcc/tree.c b/gcc/tree.c
index acc3841..10f50de 100644
--- a/gcc/tree.c
+++ b/gcc/tree.c
@@ -10596,9 +10596,14 @@ walk_tree_1 (tree *tp, walk_tree_fn func, void *data,
if (result || !walk_subtrees)
return result;
- result = walk_type_fields (*type_p, func, data, pset, lh);
- if (result)
- return result;
+ /* But do not walk a pointed-to type since it may itself need to
+ be walked in the declaration case if it isn't anonymous. */
+ if (!POINTER_TYPE_P (*type_p))
+ {
+ result = walk_type_fields (*type_p, func, data, pset, lh);
+ if (result)
+ return result;
+ }
/* If this is a record type, also walk the fields. */
if (RECORD_OR_UNION_TYPE_P (*type_p))