From: Michael Beck Date: Thu, 28 Feb 2008 17:30:20 +0000 (+0000) Subject: new_ir_node() uses always flexible array for End nodes X-Git-Url: http://nsz.repo.hu/git/?a=commitdiff_plain;h=f7ed4d2fe766aa00f3118ef5b078976dbf633440;p=libfirm new_ir_node() uses always flexible array for End nodes [r17929] --- diff --git a/ir/ir/irnode.c b/ir/ir/irnode.c index c3be35a34..05069a8c7 100644 --- a/ir/ir/irnode.c +++ b/ir/ir/irnode.c @@ -154,7 +154,11 @@ new_ir_node(dbg_info *db, ir_graph *irg, ir_node *block, ir_op *op, ir_mode *mod if (arity < 0) { res->in = NEW_ARR_F(ir_node *, 1); /* 1: space for block */ } else { - res->in = NEW_ARR_D(ir_node *, irg->obst, (arity+1)); + /* not nice but necessary: End must always have a flexible array */ + if (op == op_End) + res->in = NEW_ARR_F(ir_node *, (arity+1)); + else + res->in = NEW_ARR_D(ir_node *, irg->obst, (arity+1)); memcpy(&res->in[1], in, sizeof(ir_node *) * arity); }