mirror of
https://git.code.sf.net/p/quake/quakeforge
synced 2024-11-22 20:41:20 +00:00
detect multiple initializations of globals
This commit is contained in:
parent
8a9cd78072
commit
2d766710b6
1 changed files with 7 additions and 3 deletions
|
@ -409,11 +409,15 @@ var_initializer
|
|||
def_initialized ($<def>0);
|
||||
} else {
|
||||
if ($2->type >= ex_string) {
|
||||
if ($<def>0->constant) {
|
||||
error ($2, "%s re-initialized", $<def>0->name);
|
||||
} else {
|
||||
if ($<def>0->type->type == ev_func) {
|
||||
PARSE_ERROR;
|
||||
} else {
|
||||
ReuseConstant ($2, $<def>0);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
error ($2, "non-constant expression used for initializer");
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue