From 8d86d7d1c13bb51fa816e707a1d101061518fcba Mon Sep 17 00:00:00 2001 From: Wolfgang Bumiller Date: Thu, 20 Dec 2012 21:05:29 +0100 Subject: [PATCH] Don't check for is_return but for final at the end of a function so that if 'goto' is the last expression we don't try to append a return --- ast.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ast.c b/ast.c index 7fcab15..04e13b8 100644 --- a/ast.c +++ b/ast.c @@ -1505,7 +1505,7 @@ bool ast_function_codegen(ast_function *self, ir_builder *ir) } /* TODO: check return types */ - if (!self->curblock->is_return) + if (!self->curblock->final) { if (!self->vtype->expression.next || self->vtype->expression.next->expression.vtype == TYPE_VOID) -- 2.39.2