]> git.xonotic.org Git - xonotic/gmqcc.git/commitdiff
Revert "search for funciton param first before function locals, this fixes #163"
authorWolfgang Bumiller <wry.git@bumiller.com>
Sun, 14 Jan 2018 08:32:53 +0000 (09:32 +0100)
committerWolfgang Bumiller <wry.git@bumiller.com>
Sun, 14 Jan 2018 08:33:05 +0000 (09:33 +0100)
This reverts commit 3cf2c52fce792af3e5cc5578b336de83217e625d.

parser.cpp

index 9bfd7517a26aea26b9671f362f6e9be58dcdfd50..1404273735d83f2e1f2c583e5d4905b3231008d3 100644 (file)
@@ -135,22 +135,17 @@ static ast_expression* parser_find_local(parser_t *parser, const char *name, siz
 {
     size_t          i, hash;
     ast_expression *e;
-    ast_expression *p;
 
     hash = util_hthash(parser->htglobals, name);
 
     *isparam = false;
-    p = parser_find_param(parser, name);
-    if (p) {
-        *isparam = true;
-        return p;
-    }
     for (i = parser->variables.size(); i > upto;) {
         --i;
         if ( (e = (ast_expression*)util_htgeth(parser->variables[i], name, hash)) )
             return e;
     }
-    return NULL;
+    *isparam = true;
+    return parser_find_param(parser, name);
 }
 
 static ast_expression* parser_find_local(parser_t *parser, const std::string &name, size_t upto, bool *isparam) {