From: Wolfgang Bumiller Date: Thu, 20 Dec 2012 20:05:29 +0000 (+0100) Subject: Don't check for is_return but for final at the end of a function so that if 'goto... X-Git-Tag: 0.2~37 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=8d86d7d1c13bb51fa816e707a1d101061518fcba;p=xonotic%2Fgmqcc.git 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 --- 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)