From 2d766710b6033bc9e4fa65a164d19997c3a27e24 Mon Sep 17 00:00:00 2001 From: Bill Currie Date: Wed, 29 Jan 2003 22:29:37 +0000 Subject: [PATCH] detect multiple initializations of globals --- tools/qfcc/source/qc-parse.y | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/tools/qfcc/source/qc-parse.y b/tools/qfcc/source/qc-parse.y index 26ba538be..32025eafa 100644 --- a/tools/qfcc/source/qc-parse.y +++ b/tools/qfcc/source/qc-parse.y @@ -409,10 +409,14 @@ var_initializer def_initialized ($0); } else { if ($2->type >= ex_string) { - if ($0->type->type == ev_func) { - PARSE_ERROR; + if ($0->constant) { + error ($2, "%s re-initialized", $0->name); } else { - ReuseConstant ($2, $0); + if ($0->type->type == ev_func) { + PARSE_ERROR; + } else { + ReuseConstant ($2, $0); + } } } else { error ($2, "non-constant expression used for initializer");