Prevent beuses from choking on basic blocks without control flow successors.
[libfirm] / ir / be / beuses.c
index aa97898..dcef874 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 1995-2007 University of Karlsruhe.  All right reserved.
+ * Copyright (C) 1995-2008 University of Karlsruhe.  All right reserved.
  *
  * This file is part of libFirm.
  *
@@ -126,10 +126,12 @@ static int be_is_phi_argument(const ir_node *block, const ir_node *def)
        const ir_edge_t *edge;
        int arity, i;
 
-#if 0
-       if(get_irn_n_edges_kind(block, EDGE_KIND_BLOCK) > 1)
-               return 0;
+#if 1
+       if (get_irn_n_edges_kind(block, EDGE_KIND_BLOCK) < 1)
+#else
+       if (get_irn_n_edges_kind(block, EDGE_KIND_BLOCK) != 1)
 #endif
+               return 0;
 
        foreach_block_succ(block, edge) {
                succ_block = get_edge_src_irn(edge);
@@ -284,6 +286,7 @@ static be_next_use_t get_next_use(be_uses_t *env, ir_node *from,
        ir_graph *irg       = get_irn_irg(block);
        ir_node *startblock = get_irg_start_block(irg);
 
+       result.before  = NULL;
        outermost_loop = loopdepth;
        foreach_block_succ(block, edge) {
                const be_use_t *use;