mirror of
https://github.com/DarkPlacesEngine/gmqcc.git
synced 2024-11-23 20:33:05 +00:00
Don't have the ast's codegen error on missing returns
This commit is contained in:
parent
7ef248aadb
commit
1cc3705da4
1 changed files with 4 additions and 0 deletions
4
ast.c
4
ast.c
|
@ -934,6 +934,9 @@ 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);
|
||||
/* From now on the parser has to handle this situation */
|
||||
#if 0
|
||||
if (!self->vtype->expression.next ||
|
||||
self->vtype->expression.next->expression.vtype == TYPE_VOID)
|
||||
{
|
||||
|
@ -945,6 +948,7 @@ bool ast_function_codegen(ast_function *self, ir_builder *ir)
|
|||
asterror(ast_ctx(self), "function `%s` missing return value", self->name);
|
||||
return false;
|
||||
}
|
||||
#endif
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue