make get_entity_irg return NULL for non methods as documented in typerep.h
authorMatthias Braun <matze@braunis.de>
Tue, 13 Jan 2009 12:03:14 +0000 (12:03 +0000)
committerMatthias Braun <matze@braunis.de>
Tue, 13 Jan 2009 12:03:14 +0000 (12:03 +0000)
[r25163]

ir/tr/entity_t.h

index cc5e82f..92aee12 100644 (file)
@@ -420,7 +420,10 @@ static inline ir_graph *
 _get_entity_irg(const ir_entity *ent) {
        ir_graph *irg;
        assert(ent && ent->kind == k_entity);
-       assert(ent == unknown_entity || is_Method_type(ent->type));
+       if (!is_Method_type(ent->type) || ent == unknown_entity) {
+               return NULL;
+       }
+
        irg = ent->attr.mtd_attr.irg;
        if (irg != NULL && !get_visit_pseudo_irgs()     && is_pseudo_ir_graph(irg))
                return NULL;