mirror of
https://github.com/DarkPlacesEngine/gmqcc.git
synced 2025-03-23 11:11:22 +00:00
Error in the ast already about unreachable statements and don't upset the IR
This commit is contained in:
parent
ea75003cf4
commit
8ac689c03a
1 changed files with 4 additions and 0 deletions
4
ast.c
4
ast.c
|
@ -1361,6 +1361,10 @@ bool ast_block_codegen(ast_block *self, ast_function *func, bool lvalue, ir_valu
|
|||
for (i = 0; i < vec_size(self->exprs); ++i)
|
||||
{
|
||||
ast_expression_codegen *gen = self->exprs[i]->expression.codegen;
|
||||
if (func->curblock->final) {
|
||||
asterror(ast_ctx(self->exprs[i]), "unreachable statement");
|
||||
return false;
|
||||
}
|
||||
if (!(*gen)(self->exprs[i], func, false, out))
|
||||
return false;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue