From: Andreas Zwinkau Date: Thu, 1 Sep 2011 14:27:33 +0000 (+0200) Subject: Let collect_nodes cope with Bad nodes X-Git-Url: http://nsz.repo.hu/git/?a=commitdiff_plain;h=fe6c9130a81330693ec34a0e2a261ccf47b48599;p=libfirm Let collect_nodes cope with Bad nodes --- diff --git a/ir/opt/cfopt.c b/ir/opt/cfopt.c index 6beeb9999..33afb2469 100644 --- a/ir/opt/cfopt.c +++ b/ir/opt/cfopt.c @@ -115,9 +115,15 @@ static void collect_nodes(ir_node *n, void *ctx) /* block with a jump label attached cannot be removed. */ set_Block_removable(n, false); } + } else if (is_Bad(n) || is_Jmp(n)) { + /* ignore these */ return; - } else if (!is_Jmp(n)) { /* Check for non-empty block. */ + } else { + /* Check for non-empty block. */ ir_node *block = get_nodes_block(n); + if (is_Bad(block)) + return; + set_Block_removable(block, false); if (is_Proj(n)) {