mirror of
https://github.com/DarkPlacesEngine/gmqcc.git
synced 2025-04-13 13:32:46 +00:00
error if a function is called from global scope opposed to crashing
This commit is contained in:
parent
97a74eb677
commit
9a21c638fa
1 changed files with 6 additions and 0 deletions
|
@ -1188,6 +1188,12 @@ static bool parser_sy_apply_operator(parser_t *parser, shunt *sy)
|
|||
|
||||
static bool parser_close_call(parser_t *parser, shunt *sy)
|
||||
{
|
||||
if (!parser->function)
|
||||
{
|
||||
parseerror(parser, "cannot call functions from global scope");
|
||||
return false;
|
||||
}
|
||||
|
||||
/* was a function call */
|
||||
ast_expression *fun;
|
||||
ast_value *funval = nullptr;
|
||||
|
|
Loading…
Reference in a new issue