]> git.rm.cloudns.org Git - xonotic/gmqcc.git/commitdiff
allow initializing shadowed locals outside of -std=gmqcc - in this case it becomes...
authorWolfgang Bumiller <wry.git@bumiller.com>
Wed, 28 Aug 2013 12:20:33 +0000 (14:20 +0200)
committerWolfgang Bumiller <wry.git@bumiller.com>
Wed, 28 Aug 2013 12:20:33 +0000 (14:20 +0200)
parser.c

index 9ed80431364fc6b04692362effdad2bfd265dfcf..9cbd30e6d149dbc028ee695cf54f6efc303df4e7 100644 (file)
--- 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;
+                    }
                 }
             }
         }