From ee96ce90ca6d645620019c7fd3289f22ddae7b73 Mon Sep 17 00:00:00 2001 From: Richard Sandiford Date: Fri, 15 Feb 2002 16:08:21 +0000 Subject: [PATCH] * c-decl.c (grokdeclarator): Prevent a segfault on unnamed decls. From-SVN: r49791 --- gcc/ChangeLog | 4 ++++ gcc/c-decl.c | 4 ++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 5607a0b298b..e4f023f9670 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,7 @@ +2002-02-15 Richard Sandiford + + * c-decl.c (grokdeclarator): Prevent a segfault on unnamed decls. + 2002-02-15 Richard Sandiford * reload.c (find_dummy_reload): Check that an output register diff --git a/gcc/c-decl.c b/gcc/c-decl.c index ea7942c7243..1ab120af1df 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), -- 2.30.2