From: Wolfgang (Blub) Bumiller Date: Fri, 30 Nov 2012 11:35:33 +0000 (+0100) Subject: Actually generate the missing return instruction X-Git-Tag: 0.1.9~190 X-Git-Url: https://git.xonotic.org/?p=xonotic%2Fgmqcc.git;a=commitdiff_plain;h=39b8d8431c5ae9cd630113932836d20e781b27ae Actually generate the missing return instruction --- diff --git a/ast.c b/ast.c index ead4ea9..22081b5 100644 --- a/ast.c +++ b/ast.c @@ -1446,9 +1446,6 @@ 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); - */ if (!self->vtype->expression.next || self->vtype->expression.next->expression.vtype == TYPE_VOID) { @@ -1463,6 +1460,7 @@ bool ast_function_codegen(ast_function *self, ir_builder *ir) { return false; } + return ir_block_create_return(self->curblock, NULL); } } return true;