summaryrefslogtreecommitdiffhomepage
path: root/ir/ir
diff options
context:
space:
mode:
authorChristoph Mallon <christoph.mallon@gmx.de>2018-03-06 08:50:46 +0100
committerChristoph Mallon <christoph.mallon@gmx.de>2018-03-06 12:28:09 +0100
commita9aabefe2ebd36859aafa1fbab212f32669ae4ce (patch)
treefae147baa432dc180ab512422ee031d2d1fb33ac /ir/ir
parentdf75923621ade93a93458429fb54768c55bd4f9d (diff)
ir: Assert that get_memop_mem() actually returns a memory node.
Diffstat (limited to 'ir/ir')
-rw-r--r--ir/ir/irnode.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/ir/ir/irnode.c b/ir/ir/irnode.c
index 37b0a4d..16d05ed 100644
--- a/ir/ir/irnode.c
+++ b/ir/ir/irnode.c
@@ -622,7 +622,9 @@ ir_node *get_memop_mem(const ir_node *node)
{
const ir_op *op = get_irn_op(node);
assert(is_memop(node));
- return get_irn_n(node, op->memory_index);
+ ir_node *const mem = get_irn_n(node, op->memory_index);
+ assert(get_irn_mode(mem) == mode_M);
+ return mem;
}
void set_memop_mem(ir_node *node, ir_node *mem)