mirror of
https://git.code.sf.net/p/quake/quakeforge
synced 2024-11-27 06:34:11 +00:00
Use the def type rather than expression type to select the init method.
Local defs may be initialized with non-constant expressions, which includes function calls. Both function calls and aggregate initializers use block expressions.
This commit is contained in:
parent
19f6faf0ad
commit
4e86b28b59
1 changed files with 1 additions and 1 deletions
|
@ -339,7 +339,7 @@ initialize_def (symbol_t *sym, type_t *type, expr_t *init, defspace_t *space,
|
||||||
return;
|
return;
|
||||||
if (init->type == ex_nil)
|
if (init->type == ex_nil)
|
||||||
convert_nil (init, type);
|
convert_nil (init, type);
|
||||||
if (init->type == ex_block) {
|
if (is_array (type) || is_struct (type)) {
|
||||||
init_elements (sym->s.def, init);
|
init_elements (sym->s.def, init);
|
||||||
} else {
|
} else {
|
||||||
if (!type_assignable (type, get_type (init))) {
|
if (!type_assignable (type, get_type (init))) {
|
||||||
|
|
Loading…
Reference in a new issue