re PR c/25875 (ICE: segmentation fault)

PR c/25875
	* c-typeck.c (digest_init): Robustify.

	* gcc.dg/init-bad-4.c: New test.

From-SVN: r113153
This commit is contained in:
Volker Reichelt 2006-04-21 23:02:26 +00:00 committed by Volker Reichelt
parent 5d5e98dc75
commit f01da1a506
4 changed files with 14 additions and 0 deletions

View File

@ -1,5 +1,8 @@
2006-04-21 Volker Reichelt <reichelt@igpm.rwth-aachen.de>
PR c/25875
* c-typeck.c (digest_init): Robustify.
* c-typeck.c (pop_init_level): Simplify.
2006-04-21 Steve Ellcey <sje@cup.hp.com>

View File

@ -4495,6 +4495,7 @@ digest_init (tree type, tree init, bool strict_string, int require_constant)
tree inside_init = init;
if (type == error_mark_node
|| !init
|| init == error_mark_node
|| TREE_TYPE (init) == error_mark_node)
return error_mark_node;

View File

@ -1,3 +1,8 @@
2006-04-21 Volker Reichelt <reichelt@igpm.rwth-aachen.de>
PR c/25875
* gcc.dg/init-bad-4.c: New test.
2006-04-21 Paul Brook <paul@codesourcery.com>
* gcc.dg/arm-vfp1.c: Skip on iWMMXt cpus.

View File

@ -0,0 +1,5 @@
/* PR c/25875 */
/* Origin: Richard Guenther <rguenth@gcc.gnu.org> */
/* { dg-do compile } */
struct A { } a = (struct A) {{ (X)0 }}; /* { dg-error "no members|extra brace|near|undeclared|constant|compound" } */