]> git.xonotic.org Git - xonotic/gmqcc.git/blobdiff - ast.c
-fallow-unreachable-code
[xonotic/gmqcc.git] / ast.c
diff --git a/ast.c b/ast.c
index 93d2a173f9c4a37686229c223e936ac38f7e94a8..8a70549b59338fa48be68f6e2293211594ac99ad 100644 (file)
--- a/ast.c
+++ b/ast.c
@@ -1570,6 +1570,8 @@ bool ast_block_codegen(ast_block *self, ast_function *func, bool lvalue, ir_valu
     {
         ast_expression_codegen *gen = self->exprs[i]->expression.codegen;
         if (func->curblock->final && !ast_istype(self->exprs[i], ast_label)) {
+            if (OPTS_FLAG(ALLOW_UNREACHABLE_CODE))
+                continue;
             compile_error(ast_ctx(self->exprs[i]), "unreachable statement");
             return false;
         }