get_irn_MacroBlock(): if the Block of a node is Bad, do NOT try to returns its MB...
authorMichael Beck <beck@ipd.info.uni-karlsruhe.de>
Mon, 7 Jan 2008 19:37:24 +0000 (19:37 +0000)
committerMichael Beck <beck@ipd.info.uni-karlsruhe.de>
Mon, 7 Jan 2008 19:37:24 +0000 (19:37 +0000)
[r17201]

ir/ir/irnode.c

index 708ac70..4064cbb 100644 (file)
@@ -879,8 +879,12 @@ ir_node *get_Block_MacroBlock(const ir_node *block) {
 
 /* returns the macro block header of a node. */
 ir_node *get_irn_MacroBlock(const ir_node *n) {
-       if (! is_Block(n))
+       if (! is_Block(n)) {
                n = get_nodes_block(n);
+               /* if the Block is Bad, do NOT try to get it's MB, it will fail. */
+               if (is_Bad(n))
+                       return n;
+       }
        return get_Block_MacroBlock(n);
 }