aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--gcc/ChangeLog4
-rw-r--r--gcc/c-decl.c4
2 files changed, 6 insertions, 2 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 5607a0b..e4f023f9 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,5 +1,9 @@
2002-02-15 Richard Sandiford <rsandifo@redhat.com>
+ * c-decl.c (grokdeclarator): Prevent a segfault on unnamed decls.
+
+2002-02-15 Richard Sandiford <rsandifo@redhat.com>
+
* reload.c (find_dummy_reload): Check that an output register
is valid for its mode.
diff --git a/gcc/c-decl.c b/gcc/c-decl.c
index ea7942c..1ab120a 100644
--- a/gcc/c-decl.c
+++ b/gcc/c-decl.c
@@ -4534,9 +4534,9 @@ grokdeclarator (declarator, declspecs, decl_context, initialized)
if (inner_decl == NULL_TREE
|| TREE_CODE (inner_decl) == IDENTIFIER_NODE)
attr_flags |= (int) ATTR_FLAG_DECL_NEXT;
- if (TREE_CODE (inner_decl) == CALL_EXPR)
+ else if (TREE_CODE (inner_decl) == CALL_EXPR)
attr_flags |= (int) ATTR_FLAG_FUNCTION_NEXT;
- if (TREE_CODE (inner_decl) == ARRAY_REF)
+ else if (TREE_CODE (inner_decl) == ARRAY_REF)
attr_flags |= (int) ATTR_FLAG_ARRAY_NEXT;
returned_attrs = decl_attributes (&type,
chainon (returned_attrs, attrs),