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

This commit is contained in:
Wolfgang Bumiller 2012-12-20 21:05:29 +01:00
parent 93341dd009
commit 8d86d7d1c1

2
ast.c
View file

@ -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)