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
This commit is contained in:
parent
7e7d951756
commit
6894017546
@ -1,5 +1,8 @@
|
||||
2000-12-29 Alexandre Oliva <aoliva@redhat.com>
|
||||
|
||||
* c-decl.c (grokdeclarator): Prevent crash in case of overflow in
|
||||
array size.
|
||||
|
||||
* calls.c (emit_library_call_value_1): Add to call_fusage the
|
||||
stack slot assigned to argument passed by reference.
|
||||
|
||||
|
@ -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);
|
||||
/* 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. */
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user