From: Wolfgang Bumiller Date: Wed, 28 Aug 2013 12:20:33 +0000 (+0200) Subject: allow initializing shadowed locals outside of -std=gmqcc - in this case it becomes... X-Git-Tag: 0.3.5~129 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=494c30a23985b8ecb03f83dc567970b155b6d86a;p=xonotic%2Fgmqcc.git allow initializing shadowed locals outside of -std=gmqcc - in this case it becomes a regular assignment to the old declaration which is consistent with fteqcc --- diff --git a/parser.c b/parser.c index 9ed8043..9cbd30e 100644 --- a/parser.c +++ b/parser.c @@ -5112,8 +5112,12 @@ static bool parse_variable(parser_t *parser, ast_block *localblock, bool nofield } if (OPTS_OPTION_U32(OPTION_STANDARD) != COMPILER_GMQCC) { ast_delete(var); - var = NULL; - goto skipvar; + if (ast_istype(old, ast_value)) + var = (ast_value*)old; + else { + var = NULL; + goto skipvar; + } } } }