X-Git-Url: http://nsz.repo.hu/git/?a=blobdiff_plain;f=ir%2Fir%2Firgopt.c;h=ad794eb1b000ff54a65d439d349916dc21ab42c8;hb=8f355cb9b3d20c10f71d1b1e17cbf59a51ced83b;hp=cec08921f4f7922e06bb54dac213394a314215ed;hpb=e153c0201ad4b75fa63cacd746cf6295bde5cbdc;p=libfirm diff --git a/ir/ir/irgopt.c b/ir/ir/irgopt.c index cec08921f..ad794eb1b 100644 --- a/ir/ir/irgopt.c +++ b/ir/ir/irgopt.c @@ -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. * @@ -339,9 +339,13 @@ static void copy_node(ir_node *n, void *env) { get_irn_mode(n), new_arity, get_irn_in(n) + 1); - /* Copy the attributes. These might point to additional data. If this - was allocated on the old obstack the pointers now are dangling. This - frees e.g. the memory of the graph_arr allocated in new_immBlock. */ + /* Copy the attributes. These might point to additional data. If this + was allocated on the old obstack the pointers now are dangling. This + frees e.g. the memory of the graph_arr allocated in new_immBlock. */ + if (op == op_Block) { + /* we cannot allow blocks WITHOUT macroblock input */ + set_irn_n(nn, -1, get_irn_n(n, -1)); + } copy_node_attr(n, nn); #ifdef DEBUG_libfirm @@ -378,7 +382,9 @@ static void copy_preds(ir_node *n, void *env) { set_irn_n(nn, -1, nn); } else { /* get the macro block header */ - set_irn_n(nn, -1, get_new_node(mbh)); + ir_node *nmbh = get_new_node(mbh); + assert(nmbh != NULL); + set_irn_n(nn, -1, nmbh); } /* Don't copy Bad nodes. */