Fix expression initializers for arrays and structs.

This commit is contained in:
Bill Currie 2011-03-02 22:28:17 +09:00
parent 76f912c7a1
commit c06dd776d2

View file

@ -356,7 +356,8 @@ initialize_def (symbol_t *sym, type_t *type, expr_t *init, defspace_t *space,
return;
if (init->type == ex_nil)
convert_nil (init, type);
if (is_array (type) || is_struct (type)) {
if ((is_array (type) || is_struct (type))
&& init->type == ex_block && !init->e.block.result) {
init_elements (sym->s.def, init);
} else {
if (!type_assignable (type, get_type (init))) {