aboutsummaryrefslogtreecommitdiff
path: root/gcc/c-decl.c
diff options
context:
space:
mode:
authorAlexandre Oliva <aoliva@redhat.com>2000-12-29 08:03:56 +0000
committerAlexandre Oliva <aoliva@gcc.gnu.org>2000-12-29 08:03:56 +0000
commit68940175460a147340617aa400213b32fda99fc4 (patch)
tree5b5e361f6a06b4c347e6c6f865287c196fa1c6f0 /gcc/c-decl.c
parent7e7d95175604e98bd3d23134f6d708d87a66b5ed (diff)
downloadgcc-68940175460a147340617aa400213b32fda99fc4.zip
gcc-68940175460a147340617aa400213b32fda99fc4.tar.gz
gcc-68940175460a147340617aa400213b32fda99fc4.tar.bz2
c-decl.c (grokdeclarator): Prevent crash in case of overflow in array size.
* c-decl.c (grokdeclarator): Prevent crash in case of overflow in array size. From-SVN: r38526
Diffstat (limited to 'gcc/c-decl.c')
-rw-r--r--gcc/c-decl.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/gcc/c-decl.c b/gcc/c-decl.c
index f10f4b0..92d8403 100644
--- a/gcc/c-decl.c
+++ b/gcc/c-decl.c
@@ -4684,7 +4684,12 @@ grokdeclarator (declarator, declspecs, decl_context, initialized)
if (TREE_CODE (type) == ARRAY_TYPE
&& COMPLETE_TYPE_P (type)
&& TREE_OVERFLOW (TYPE_SIZE (type)))
- error ("size of array `%s' is too large", name);
+ {
+ error ("size of array `%s' is too large", name);
+ /* If we proceed with the array type as it is, we'll eventully
+ crash in tree_low_cst(). */
+ type = error_mark_node;
+ }
/* If this is declaring a typedef name, return a TYPE_DECL. */