diff options
author | Richard Stallman <rms@gnu.org> | 1992-08-18 02:55:07 +0000 |
---|---|---|
committer | Richard Stallman <rms@gnu.org> | 1992-08-18 02:55:07 +0000 |
commit | 2726966da1c45270dea4f8a5821ea91ef738ff8f (patch) | |
tree | f19930b06c8da3cd48876481ed0fd1ef395edeec /gcc | |
parent | 68a8ca25ec1537e763b07381ed0ad1f5d8fa16ab (diff) | |
download | gcc-2726966da1c45270dea4f8a5821ea91ef738ff8f.zip gcc-2726966da1c45270dea4f8a5821ea91ef738ff8f.tar.gz gcc-2726966da1c45270dea4f8a5821ea91ef738ff8f.tar.bz2 |
(digest_init): Test TREE_TYPE (inside_init) is
nonzero before testing anything else about it.
From-SVN: r1879
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/c-typeck.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/gcc/c-typeck.c b/gcc/c-typeck.c index 18f2ed5..c20cbec 100644 --- a/gcc/c-typeck.c +++ b/gcc/c-typeck.c @@ -4603,12 +4603,12 @@ digest_init (type, init, tail, require_constant, constructor_constant, ofwhat) from an expression of the same type, optionally with braces. For an array, this is allowed only for a string constant. */ - if (inside_init - && (TYPE_MAIN_VARIANT (TREE_TYPE (inside_init)) == TYPE_MAIN_VARIANT (type) - || (code == ARRAY_TYPE && TREE_TYPE (inside_init) + if (inside_init && TREE_TYPE (inside_init) != 0 + && ((TYPE_MAIN_VARIANT (TREE_TYPE (inside_init)) + == TYPE_MAIN_VARIANT (type))) + || (code == ARRAY_TYPE && comptypes (TREE_TYPE (inside_init), type)) || (code == POINTER_TYPE - && TREE_TYPE (inside_init) != 0 && (TREE_CODE (TREE_TYPE (inside_init)) == ARRAY_TYPE || TREE_CODE (TREE_TYPE (inside_init)) == FUNCTION_TYPE) && comptypes (TREE_TYPE (TREE_TYPE (inside_init)), |