- /*
- * Note that Phi predecessors are always block entries
- * because Phi edges are always "outside" a block
- */
- if (block != blk || is_phi) {
- entry = block_find_entry(blk, env);
- ARR_APP1(ir_node *, entry->entry_list, pred);
+ /* BEWARE: predecessors of End nodes might be blocks */
+ if (is_no_Block(pred)) {
+ ir_node *blk = get_nodes_block(pred);
+
+ /*
+ * Note that Phi predecessors are always block entries
+ * because Phi edges are always "outside" a block
+ */
+ if (block != blk || is_phi) {
+ entry = block_find_entry(blk, env);
+ ARR_APP1(ir_node *, entry->entry_list, pred);
+ }