From: Wolfgang Bumiller Date: Mon, 31 Dec 2012 10:39:00 +0000 (+0100) Subject: Explicitly allow 'return nil' X-Git-Tag: before-library~414 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=2cf4b4e56dc0783a837efb91a3db81c98b4e4fc3;p=xonotic%2Fgmqcc.git Explicitly allow 'return nil' --- diff --git a/parser.c b/parser.c index edf4f2a..8fe2c31 100644 --- a/parser.c +++ b/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"); }