From b7b24e372a1338ecd5eb26bdd285a8cbe7b1fec9 Mon Sep 17 00:00:00 2001 From: Michael Beck Date: Sun, 3 Apr 2011 18:36:47 +0200 Subject: [PATCH] Add assertions if set_cur_block() is tried for a block on a wrong irg. Fixed typo. --- ir/ir/ircons.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/ir/ir/ircons.c b/ir/ir/ircons.c index 2973c8b61..0b765a41e 100644 --- a/ir/ir/ircons.c +++ b/ir/ir/ircons.c @@ -281,7 +281,7 @@ static ir_node *get_r_value_internal(ir_node *block, int pos, ir_mode *mode) if (res != NULL) return res; - /* in a matured block we can immediated determine the phi arguments */ + /* in a matured block we can immediately determine the phi arguments */ if (block->attr.block.is_matured) { int arity = get_irn_arity(block); /* no predecessors: use unknown value */ @@ -543,11 +543,13 @@ void add_immBlock_pred(ir_node *block, ir_node *jmp) void set_cur_block(ir_node *target) { + assert(current_ir_graph == get_irn_irg(target)); current_ir_graph->current_block = target; } void set_r_cur_block(ir_graph *irg, ir_node *target) { + assert(irg == get_irn_irg(target)); irg->current_block = target; } -- 2.20.1