From 0301ea78183e2b318e13eb64f47e206b4bcfdbb2 Mon Sep 17 00:00:00 2001 From: "Wolfgang (Blub) Bumiller" Date: Sun, 25 Nov 2012 21:59:57 +0100 Subject: [PATCH] Don't error about creating an unreachable statement if the node we're about to generate is an ast_label --- ast.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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; } -- 2.39.2