From: Jeff Law Date: Wed, 21 Feb 1996 17:44:20 +0000 (-0700) Subject: c-typeck.c (initializer_constant_valid_p): Don't dereference a null pointer on partia... X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=d6d22108aca24b78d635dedd1f5cf18feffa316d;p=gcc.git c-typeck.c (initializer_constant_valid_p): Don't dereference a null pointer on partial structure initialization. * c-typeck.c (initializer_constant_valid_p): Don't dereference a null pointer on partial structure initialization. From-SVN: r11333 --- diff --git a/gcc/c-typeck.c b/gcc/c-typeck.c index da52a8da608..0ffbf80a8e9 100644 --- a/gcc/c-typeck.c +++ b/gcc/c-typeck.c @@ -4279,7 +4279,8 @@ initializer_constant_valid_p (value, endtype) case CONSTRUCTOR: if ((TREE_CODE (TREE_TYPE (value)) == UNION_TYPE || TREE_CODE (TREE_TYPE (value)) == RECORD_TYPE) - && TREE_CONSTANT (value)) + && TREE_CONSTANT (value) + && CONSTRUCTOR_ELTS (value)) return initializer_constant_valid_p (TREE_VALUE (CONSTRUCTOR_ELTS (value)), endtype);