Revert "search for funciton param first before function locals, this fixes #163"

This reverts commit 3cf2c52fce.
This commit is contained in:
Wolfgang Bumiller 2018-01-14 09:32:53 +01:00
parent 73d3d7eec1
commit e006aa8238

View file

@ -135,22 +135,17 @@ static ast_expression* parser_find_local(parser_t *parser, const char *name, siz
{ {
size_t i, hash; size_t i, hash;
ast_expression *e; ast_expression *e;
ast_expression *p;
hash = util_hthash(parser->htglobals, name); hash = util_hthash(parser->htglobals, name);
*isparam = false; *isparam = false;
p = parser_find_param(parser, name);
if (p) {
*isparam = true;
return p;
}
for (i = parser->variables.size(); i > upto;) { for (i = parser->variables.size(); i > upto;) {
--i; --i;
if ( (e = (ast_expression*)util_htgeth(parser->variables[i], name, hash)) ) if ( (e = (ast_expression*)util_htgeth(parser->variables[i], name, hash)) )
return e; 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) { static ast_expression* parser_find_local(parser_t *parser, const std::string &name, size_t upto, bool *isparam) {