From: Wolfgang (Blub) Bumiller Date: Sun, 19 Aug 2012 18:28:14 +0000 (+0200) Subject: Don't have the ast's codegen error on missing returns X-Git-Tag: 0.1-rc1~146 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=1cc3705da4908a493bea2fbf6d02da1f66b6d9f0;p=xonotic%2Fgmqcc.git Don't have the ast's codegen error on missing returns --- diff --git a/ast.c b/ast.c index 7c349b4..67306a1 100644 --- a/ast.c +++ b/ast.c @@ -934,6 +934,9 @@ bool ast_function_codegen(ast_function *self, ir_builder *ir) /* TODO: check return types */ if (!self->curblock->is_return) { + return ir_block_create_return(self->curblock, NULL); + /* From now on the parser has to handle this situation */ +#if 0 if (!self->vtype->expression.next || self->vtype->expression.next->expression.vtype == TYPE_VOID) { @@ -945,6 +948,7 @@ bool ast_function_codegen(ast_function *self, ir_builder *ir) asterror(ast_ctx(self), "function `%s` missing return value", self->name); return false; } +#endif } return true; }