mirror of
https://github.com/DarkPlacesEngine/gmqcc.git
synced 2024-11-27 22:22:17 +00:00
Better handling of multiple body functions.
This commit is contained in:
parent
8e1cd4b1df
commit
31ce4c2afa
1 changed files with 6 additions and 0 deletions
6
parser.c
6
parser.c
|
@ -3981,6 +3981,12 @@ static bool parse_function_body(parser_t *parser, ast_value *var)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (var->hasvalue) {
|
||||||
|
parseerror(parser, "function `%s` declared with multiple bodies", var->name);
|
||||||
|
ast_block_delete(block);
|
||||||
|
goto enderr;
|
||||||
|
}
|
||||||
|
|
||||||
func = ast_function_new(ast_ctx(var), var->name, var);
|
func = ast_function_new(ast_ctx(var), var->name, var);
|
||||||
if (!func) {
|
if (!func) {
|
||||||
parseerror(parser, "failed to allocate function for `%s`", var->name);
|
parseerror(parser, "failed to allocate function for `%s`", var->name);
|
||||||
|
|
Loading…
Reference in a new issue