Prevent aliasing functions through forward declared prototypes. This closes #125

This commit is contained in:
Dale Weiler 2013-10-16 23:37:39 -04:00
parent 0f479f3e88
commit 003bb9dfb4

View file

@ -5088,6 +5088,13 @@ static bool parse_variable(parser_t *parser, ast_block *localblock, bool nofield
var->expression.flags & AST_FLAG_ALIAS)
var->desc = vstring;
if (parser_find_global(parser, var->name) && var->expression.flags & AST_FLAG_ALIAS) {
parseerror(parser, "function aliases cannot be forward declared");
retval = false;
goto cleanup;
}
/* Part 1:
* check for validity: (end_sys_..., multiple-definitions, prototypes, ...)
* Also: if there was a prototype, `var` will be deleted and set to `proto` which