From: Wolfgang (Blub) Bumiller Date: Sat, 18 Aug 2012 19:31:53 +0000 (+0200) Subject: set olddecl so we don't access a NULL value when a variable already exists X-Git-Tag: 0.1-rc1~178 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=83a758e446702fd33ca08541a9ce16d09e15d9dc;p=xonotic%2Fgmqcc.git set olddecl so we don't access a NULL value when a variable already exists --- diff --git a/parser.c b/parser.c index 0a8d537..0b9428c 100644 --- a/parser.c +++ b/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);