mirror of
https://github.com/DarkPlacesEngine/gmqcc.git
synced 2025-01-18 14:21:36 +00:00
ast_loop with no condition and no incrementor are 'for(;;)' and need to loop endlessly instead of once...
This commit is contained in:
parent
42376513e7
commit
9841bc2f0d
1 changed files with 3 additions and 3 deletions
6
ast.c
6
ast.c
|
@ -1458,8 +1458,8 @@ bool ast_function_codegen(ast_function *self, ir_builder *ir)
|
|||
{
|
||||
/* error("missing return"); */
|
||||
if (compile_warning(ast_ctx(self), WARN_MISSING_RETURN_VALUES,
|
||||
"control reaches end of non-void function (`%s`)",
|
||||
self->name))
|
||||
"control reaches end of non-void function (`%s`) via %s",
|
||||
self->name, self->curblock->label))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
@ -2475,7 +2475,7 @@ bool ast_loop_codegen(ast_loop *self, ast_function *func, bool lvalue, ir_value
|
|||
if (bincrement) tmpblock = bincrement;
|
||||
else if (bpostcond) tmpblock = bpostcond;
|
||||
else if (bprecond) tmpblock = bprecond;
|
||||
else tmpblock = bout;
|
||||
else tmpblock = bbody;
|
||||
if (!end_bbody->final && !ir_block_create_jump(end_bbody, tmpblock))
|
||||
return false;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue