From 6144100d9b805d3e0547aa2d836867fc057619ce Mon Sep 17 00:00:00 2001 From: Bill Currie Date: Fri, 24 Sep 2021 19:44:14 +0900 Subject: [PATCH] [qfcc] Check init exists before checking compound Fixes a segfault that occurred during a parse error in a def initializer. --- tools/qfcc/source/def.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/qfcc/source/def.c b/tools/qfcc/source/def.c index 700c5033b..37a06c84e 100644 --- a/tools/qfcc/source/def.c +++ b/tools/qfcc/source/def.c @@ -559,7 +559,7 @@ initialize_def (symbol_t *sym, expr_t *init, defspace_t *space, } if (!sym->s.def) { if (is_array (sym->type) && !type_size (sym->type) - && init->type == ex_compound) { + && init && init->type == ex_compound) { sym->type = array_type (sym->type->t.array.type, num_elements (init)); }