Do not actually return after generating a call, there are other isntructions following

This commit is contained in:
Wolfgang Bumiller 2012-07-04 15:16:02 +02:00
parent bcd8138e43
commit 3987509493
2 changed files with 3 additions and 1 deletions

2
ast.c
View file

@ -640,7 +640,9 @@ bool ast_function_codegen(ast_function *self, ir_builder *ir)
{
if (!self->vtype->expression.next ||
self->vtype->expression.next->expression.vtype == TYPE_VOID)
{
return ir_block_create_return(self->curblock, NULL);
}
else
{
/* error("missing return"); */

2
ir.c
View file

@ -2263,7 +2263,7 @@ tailcall:
if (code_statements_add(stmt) < 0)
return false;
}
return true;
continue;
}
if (instr->opcode == INSTR_STATE) {