]> git.xonotic.org Git - xonotic/gmqcc.git/commitdiff
Don't error about creating an unreachable statement if the node we're about to genera...
authorWolfgang (Blub) Bumiller <blub@speed.at>
Sun, 25 Nov 2012 20:59:57 +0000 (21:59 +0100)
committerWolfgang (Blub) Bumiller <blub@speed.at>
Sun, 25 Nov 2012 20:59:57 +0000 (21:59 +0100)
ast.c

diff --git a/ast.c b/ast.c
index 9a1fbe3f3960ecbff3dc1505e3579938445368e9..56821163db97d1869d7e452037555b6370827f67 100644 (file)
--- 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;
         }