From cfefd79e07f15b65b224cca15adcd1a720e1bea2 Mon Sep 17 00:00:00 2001 From: Bill Currie Date: Sat, 5 Mar 2011 09:21:12 +0900 Subject: [PATCH] Fix the source of bogus string relocs. Nested aggregate initializers were corrupting themselves. --- tools/qfcc/source/def.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tools/qfcc/source/def.c b/tools/qfcc/source/def.c index 9f373e36f..18f35cef9 100644 --- a/tools/qfcc/source/def.c +++ b/tools/qfcc/source/def.c @@ -248,6 +248,7 @@ init_elements (struct def_s *def, expr_t *eles) continue; } init_elements (&elements[i], c); + continue; } else if (c->type == ex_value) { if (c->e.value.type == ev_integer && elements[i].type->type == ev_float) @@ -269,6 +270,8 @@ init_elements (struct def_s *def, expr_t *eles) append_expr (local_expr, assign_expr (unary_expr ('.', ptr), c)); } else { + if (c->type != ex_value) + internal_error (c, "bogus expression type in init_elements()"); if (c->e.value.type == ev_string) { EMIT_STRING (def->space, g->string_var, c->e.value.v.string_val);