From: Wolfgang (Blub) Bumiller Date: Sun, 25 Nov 2012 20:59:57 +0000 (+0100) Subject: Don't error about creating an unreachable statement if the node we're about to genera... X-Git-Tag: 0.1.9~230 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=0301ea78183e2b318e13eb64f47e206b4bcfdbb2;p=xonotic%2Fgmqcc.git Don't error about creating an unreachable statement if the node we're about to generate is an ast_label --- diff --git a/ast.c b/ast.c index 9a1fbe3..5682116 100644 --- a/ast.c +++ b/ast.c @@ -1516,7 +1516,7 @@ 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) { + if (func->curblock->final && !ast_istype(self->exprs[i], ast_label)) { asterror(ast_ctx(self->exprs[i]), "unreachable statement"); return false; }