From: Michael Beck Date: Sun, 3 Apr 2011 16:36:47 +0000 (+0200) Subject: Add assertions if set_cur_block() is tried for a block on a wrong irg. X-Git-Url: http://nsz.repo.hu/git/?a=commitdiff_plain;h=b7b24e372a1338ecd5eb26bdd285a8cbe7b1fec9;p=libfirm Add assertions if set_cur_block() is tried for a block on a wrong irg. Fixed typo. --- 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; }