mirror of
https://github.com/DarkPlacesEngine/gmqcc.git
synced 2024-11-27 14:12:36 +00:00
Prevent aliasing functions through forward declared prototypes. This closes #125
This commit is contained in:
parent
0f479f3e88
commit
003bb9dfb4
1 changed files with 7 additions and 0 deletions
7
parser.c
7
parser.c
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue