From: Götz Lindenmaier Date: Tue, 3 Dec 2002 12:33:52 +0000 (+0000) Subject: Added assertions to enforce proper use of set_value, set_store X-Git-Url: http://nsz.repo.hu/git/?a=commitdiff_plain;h=beba5255fff4d41a34d91adcfccd047724c23002;p=libfirm Added assertions to enforce proper use of set_value, set_store [r528] --- diff --git a/ir/ir/ircons.c b/ir/ir/ircons.c index fdb83ddd4..0d04c8561 100644 --- a/ir/ir/ircons.c +++ b/ir/ir/ircons.c @@ -2164,6 +2164,8 @@ INLINE void set_value (int pos, ir_node *value) { assert(get_irg_phase_state (current_ir_graph) == phase_building); + assert(!get_Block_matured(current_ir_graph->current_block)); + assert(pos+1 < current_ir_graph->n_loc); current_ir_graph->current_block->attr.block.graph_arr[pos + 1] = value; } @@ -2181,8 +2183,9 @@ get_store (void) INLINE void set_store (ir_node *store) { - assert(get_irg_phase_state (current_ir_graph) == phase_building); /* GL: one could call set_value instead */ + assert(get_irg_phase_state (current_ir_graph) == phase_building); + assert(!get_Block_matured(current_ir_graph->current_block)); current_ir_graph->current_block->attr.block.graph_arr[0] = store; }