mirror of
https://github.com/DarkPlacesEngine/gmqcc.git
synced 2025-03-25 03:51:26 +00:00
Explicitly allow 'return nil'
This commit is contained in:
parent
4d5153854b
commit
2cf4b4e56d
1 changed files with 3 additions and 1 deletions
4
parser.c
4
parser.c
|
@ -2534,7 +2534,9 @@ static bool parse_return(parser_t *parser, ast_block *block, ast_expression **ou
|
|||
if (!exp)
|
||||
return false;
|
||||
|
||||
if (exp->expression.vtype != expected->expression.next->expression.vtype) {
|
||||
if (exp->expression.vtype != TYPE_NIL &&
|
||||
exp->expression.vtype != expected->expression.next->expression.vtype)
|
||||
{
|
||||
parseerror(parser, "return with invalid expression");
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue