mirror of
https://github.com/DarkPlacesEngine/gmqcc.git
synced 2025-02-17 17:11:32 +00:00
set olddecl so we don't access a NULL value when a variable already exists
This commit is contained in:
parent
fc1622140b
commit
83a758e446
1 changed files with 1 additions and 1 deletions
2
parser.c
2
parser.c
|
@ -1801,7 +1801,7 @@ static bool parser_variable(parser_t *parser, ast_block *localblock)
|
|||
return false;
|
||||
}
|
||||
|
||||
if (localblock && parser_find_local(parser, parser_tokval(parser), parser->blocklocal)) {
|
||||
if (localblock && (olddecl = parser_find_local(parser, parser_tokval(parser), parser->blocklocal))) {
|
||||
ast_value_delete(var);
|
||||
parseerror(parser, "local %s already declared here: %s:%i\n",
|
||||
parser_tokval(parser), ast_ctx(olddecl).file, (int)ast_ctx(olddecl).line);
|
||||
|
|
Loading…
Reference in a new issue