]> git.xonotic.org Git - xonotic/gmqcc.git/commitdiff
fix: declaring locals with the name of a parameter now treats the parameter as the...
authorWolfgang Bumiller <wry.git@bumiller.com>
Wed, 11 Sep 2013 09:25:44 +0000 (11:25 +0200)
committerWolfgang Bumiller <wry.git@bumiller.com>
Wed, 11 Sep 2013 09:25:44 +0000 (11:25 +0200)
parser.c

index d65eafe714eb6c8a78a752e896642cb95eb7b2cb..e3b4d9abd12ba36b418a786d16089f9d477885ad 100644 (file)
--- a/parser.c
+++ b/parser.c
@@ -5221,6 +5221,7 @@ static bool parse_variable(parser_t *parser, ast_block *localblock, bool nofield
                 retval = false;
                 goto cleanup;
             }
+            /* doing this here as the above is just for a single scope */
             old = parser_find_local(parser, var->name, 0, &isparam);
             if (old && isparam) {
                 if (parsewarning(parser, WARN_LOCAL_SHADOWS,
@@ -5234,7 +5235,7 @@ static bool parse_variable(parser_t *parser, ast_block *localblock, bool nofield
                 if (OPTS_OPTION_U32(OPTION_STANDARD) != COMPILER_GMQCC) {
                     ast_delete(var);
                     if (ast_istype(old, ast_value))
-                        var = (ast_value*)old;
+                        var = proto = (ast_value*)old;
                     else {
                         var = NULL;
                         goto skipvar;