mirror of
https://github.com/DarkPlacesEngine/gmqcc.git
synced 2024-11-23 20:33:05 +00:00
ast_breakcont_codegen: error when a target is missing instead of segfaulting trying to access it anyway
This commit is contained in:
parent
0564e701c0
commit
bf244fc960
1 changed files with 5 additions and 0 deletions
5
ast.c
5
ast.c
|
@ -2531,6 +2531,11 @@ bool ast_breakcont_codegen(ast_breakcont *self, ast_function *func, bool lvalue,
|
|||
else
|
||||
target = func->breakblock;
|
||||
|
||||
if (!target) {
|
||||
asterror(ast_ctx(self), "%s is lacking a target block", (self->is_continue ? "continue" : "break"));
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!ir_block_create_jump(func->curblock, target))
|
||||
return false;
|
||||
return true;
|
||||
|
|
Loading…
Reference in a new issue