From: Wolfgang (Blub) Bumiller Date: Mon, 19 Nov 2012 18:42:25 +0000 (+0100) Subject: Error in the ast already about unreachable statements and don't upset the IR X-Git-Tag: 0.1.9~398 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=8ac689c03aab29974d8a4110ff634158d703b2a8;p=xonotic%2Fgmqcc.git Error in the ast already about unreachable statements and don't upset the IR --- diff --git a/ast.c b/ast.c index 8de6e85..51912e9 100644 --- a/ast.c +++ b/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; }