From de06efa6047a682e10ee9c45ef868b7b3f1e7715 Mon Sep 17 00:00:00 2001 From: Bill Currie Date: Fri, 6 Mar 2020 20:38:40 +0900 Subject: [PATCH] [qfcc] Fix handling of nil for static initializers nil is most definitely constant. --- tools/qfcc/source/def.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/tools/qfcc/source/def.c b/tools/qfcc/source/def.c index cf36912bf..3f2f1c838 100644 --- a/tools/qfcc/source/def.c +++ b/tools/qfcc/source/def.c @@ -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);