Commit 6c99c37b by Richard Kenner

(digest_init): Don't recursively call digest_init when in traditional

mode if the type is invalid.

From-SVN: r10315
parent ebe9f727
......@@ -4894,7 +4894,7 @@ digest_init (type, init, require_constant, constructor_constant)
and it initializes the first element of x to 0. */
if (flag_traditional)
{
tree top = 0, prev = 0;
tree top = 0, prev = 0, otype = type;
while (TREE_CODE (type) == RECORD_TYPE
|| TREE_CODE (type) == ARRAY_TYPE
|| TREE_CODE (type) == QUAL_UNION_TYPE
......@@ -4916,11 +4916,17 @@ digest_init (type, init, require_constant, constructor_constant)
return error_mark_node;
}
}
TREE_OPERAND (prev, 1)
= build_tree_list (NULL_TREE,
digest_init (type, init, require_constant,
constructor_constant));
return top;
if (otype != type)
{
TREE_OPERAND (prev, 1)
= build_tree_list (NULL_TREE,
digest_init (type, init, require_constant,
constructor_constant));
return top;
}
else
return error_mark_node;
}
error_init ("invalid initializer%s", " for `%s'", NULL);
return error_mark_node;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment