Don't error about creating an unreachable statement if the node we're about to generate is an ast_label

This commit is contained in:
Wolfgang (Blub) Bumiller 2012-11-25 21:59:57 +01:00
parent e2602e6b87
commit 0301ea7818

2
ast.c
View file

@ -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;
}