From 494c30a23985b8ecb03f83dc567970b155b6d86a Mon Sep 17 00:00:00 2001 From: Wolfgang Bumiller Date: Wed, 28 Aug 2013 14:20:33 +0200 Subject: [PATCH] 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 --- parser.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) 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; + } } } } -- 2.39.2