mirror of
https://github.com/DarkPlacesEngine/gmqcc.git
synced 2024-11-23 20:33:05 +00:00
Actually generate the missing return instruction
This commit is contained in:
parent
9841bc2f0d
commit
39b8d8431c
1 changed files with 1 additions and 3 deletions
4
ast.c
4
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;
|
||||
|
|
Loading…
Reference in a new issue