From f7ed4d2fe766aa00f3118ef5b078976dbf633440 Mon Sep 17 00:00:00 2001 From: Michael Beck Date: Thu, 28 Feb 2008 17:30:20 +0000 Subject: [PATCH] new_ir_node() uses always flexible array for End nodes [r17929] --- ir/ir/irnode.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) 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); } -- 2.20.1