summaryrefslogtreecommitdiffhomepage
path: root/ir/tr
diff options
context:
space:
mode:
authorAndreas Zwinkau <zwinkau@kit.edu>2015-12-18 15:38:39 +0100
committerAndreas Zwinkau <zwinkau@kit.edu>2015-12-18 15:45:50 +0100
commit755f9742b062c4d3d3cb75e50c10c2044de7cfa8 (patch)
tree119b44f28764f5188a5dfebbffa1602ed9757ddf /ir/tr
parent926630032978de30955e525b15782ca97202f110 (diff)
Fix add_compound_member
The added unittest was failing and also x10i. Frontend moves global entity into class for native method calls. liboo lowering moves it back during vtable creation. The issue is that "pmap_insert(map,key,NULL)" does not delete an entry, so "pmap_contains(map,key)" afterwards does not return false. This changes add_compound_member to assert a NULL value instead of a NULL entry. A similar error might be in ir/be/bechordal.c.
Diffstat (limited to 'ir/tr')
-rw-r--r--ir/tr/entity.c2
-rw-r--r--ir/tr/type.c2
2 files changed, 2 insertions, 2 deletions
diff --git a/ir/tr/entity.c b/ir/tr/entity.c
index f12d1fd..42b5e9f 100644
--- a/ir/tr/entity.c
+++ b/ir/tr/entity.c
@@ -283,7 +283,7 @@ void set_entity_ld_ident(ir_entity *const ent, ident *const ld_ident)
&& get_entity_visibility(ent) != ir_visibility_private) {
pmap *globals = irp->globals;
pmap_insert(globals, old_ident, NULL);
- assert(!pmap_contains(globals, ld_ident));
+ assert(NULL == pmap_get(ir_entity, globals, ld_ident));
pmap_insert(globals, ld_ident, ent);
}
}
diff --git a/ir/tr/type.c b/ir/tr/type.c
index a10a993..6d4f45e 100644
--- a/ir/tr/type.c
+++ b/ir/tr/type.c
@@ -998,7 +998,7 @@ void add_compound_member(ir_type *type, ir_entity *entity)
ident *id = get_entity_ld_ident(entity);
pmap *globals = irp->globals;
/* Globals must have unique names. */
- assert(!pmap_contains(globals, id));
+ assert(NULL == pmap_get(ir_entity, globals, id));
pmap_insert(globals, id, entity);
}
}