X-Git-Url: http://nsz.repo.hu/git/?a=blobdiff_plain;f=ir%2Fir%2Firnode_t.h;h=474fd5524f88b70315367209aa9d4f9aebabc796;hb=1de3ff1c7f4478924c6348f774608e60b962d055;hp=ed0a3c98471379e17a981140db3281fa5a3e8b1a;hpb=65daf5bc390b02d68581f4c431dbdbfaae11b88f;p=libfirm diff --git a/ir/ir/irnode_t.h b/ir/ir/irnode_t.h index ed0a3c984..474fd5524 100644 --- a/ir/ir/irnode_t.h +++ b/ir/ir/irnode_t.h @@ -390,10 +390,14 @@ static inline ir_node *_get_Block_cfgpred(const ir_node *node, int pos) */ static inline ir_node *_get_Block_cfgpred_block(const ir_node *node, int pos) { - ir_node *res = skip_Proj(get_Block_cfgpred(node, pos)); - if (!is_Bad(res)) - res = get_nodes_block(res); - return res; + ir_node *res = get_Block_cfgpred(node, pos); + if (is_Bad(res)) { + /* must return a Bad with mode_BB! */ + ir_graph *irg = get_irn_irg(node); + return new_r_Bad(irg, mode_BB); + } else { + return get_nodes_block(skip_Proj(res)); + } } static inline ir_visited_t _get_Block_block_visited(const ir_node *node)