From 39b8d8431c5ae9cd630113932836d20e781b27ae Mon Sep 17 00:00:00 2001 From: "Wolfgang (Blub) Bumiller" Date: Fri, 30 Nov 2012 12:35:33 +0100 Subject: [PATCH] Actually generate the missing return instruction --- ast.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) 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; -- 2.39.2