[qfcc] Fix handling of nil for static initializers

nil is most definitely constant.
This commit is contained in:
Bill Currie 2020-03-06 20:38:40 +09:00
parent 9dbc81432a
commit de06efa604

View file

@ -463,7 +463,10 @@ init_elements (struct def_s *def, expr_t *eles)
if (element->expr) {
c = constant_expr (element->expr);
} else {
c = convert_nil (new_nil_expr (), element->type);
c = new_nil_expr ();
}
if (c->type == ex_nil) {
c = convert_nil (c, element->type);
}
dummy.offset = def->offset + element->offset;
g = D_POINTER (pr_type_t, &dummy);