]> git.xonotic.org Git - xonotic/gmqcc.git/blobdiff - parser.c
allow initializing shadowed locals outside of -std=gmqcc - in this case it becomes...
[xonotic/gmqcc.git] / 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;
+                    }
                 }
             }
         }