include be.h in firm.h, assert that get_value/set_value have pos>=0
authorMatthias Braun <matze@braunis.de>
Tue, 9 Dec 2008 10:08:25 +0000 (10:08 +0000)
committerMatthias Braun <matze@braunis.de>
Tue, 9 Dec 2008 10:08:25 +0000 (10:08 +0000)
[r24442]

include/libfirm/firm.h
ir/ir/ircons.c

index ffb43ed..b0361c7 100644 (file)
@@ -120,6 +120,8 @@ extern "C" {
 
 #include "iredges.h"
 
+#include "be.h"
+
 /**
  * libFirm initialization parameters.
  */
index 2d60c31..4479adf 100644 (file)
@@ -2770,6 +2770,8 @@ get_d_value(dbg_info *db, int pos, ir_mode *mode) {
        inc_irg_visited(irg);
        (void) db;
 
+       assert(pos >= 0);
+
        return get_r_value_internal(irg->current_block, pos + 1, mode);
 }  /* get_d_value */
 
@@ -2784,6 +2786,7 @@ void
 set_value(int pos, ir_node *value) {
        ir_graph *irg = current_ir_graph;
        assert(get_irg_phase_state(irg) == phase_building);
+       assert(pos >= 0);
        assert(pos+1 < irg->n_loc);
        assert(is_ir_node(value));
        irg->current_block->attr.block.graph_arr[pos + 1] = value;