Added assertions to enforce proper use of set_value, set_store
authorGötz Lindenmaier <goetz@ipd.info.uni-karlsruhe.de>
Tue, 3 Dec 2002 12:33:52 +0000 (12:33 +0000)
committerGötz Lindenmaier <goetz@ipd.info.uni-karlsruhe.de>
Tue, 3 Dec 2002 12:33:52 +0000 (12:33 +0000)
[r528]

ir/ir/ircons.c

index fdb83dd..0d04c85 100644 (file)
@@ -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;
 }