From: Boris Boesler Date: Wed, 18 Jul 2001 12:12:47 +0000 (+0000) Subject: minor bugfix X-Git-Url: http://nsz.repo.hu/git/?a=commitdiff_plain;h=821fc793c4f1daca9f1ebbb1eb0d8f440de7376b;p=libfirm minor bugfix [r242] --- diff --git a/ir/tr/type.c b/ir/tr/type.c index ad016d420..f8dfbca29 100644 --- a/ir/tr/type.c +++ b/ir/tr/type.c @@ -237,8 +237,8 @@ void add_class_subtype (type *clss, type *subtype) { int i; assert(clss && (clss->type_op == type_class)); ARR_APP1 (type *, clss->attr.ca.subtypes, subtype); - for (i = 0; i < get_class_n_subtype(subtype); i++) - if (get_class_subtype(subtype, i) == clss) + for (i = 0; i < get_class_n_supertype(subtype); i++) + if (get_class_supertype(subtype, i) == clss) /* Class already registered */ return; ARR_APP1 (type *, subtype->attr.ca.supertypes, clss); @@ -272,8 +272,8 @@ void add_class_supertype (type *clss, type *supertype) { assert(clss && (clss->type_op == type_class)); assert(supertype && (supertype -> type_op == type_class)); ARR_APP1 (type *, clss->attr.ca.supertypes, supertype); - for (i = 0; i < get_class_n_supertype(supertype); i++) - if (get_class_supertype(supertype, i) == clss) + for (i = 0; i < get_class_n_subtype(supertype); i++) + if (get_class_subtype(supertype, i) == clss) /* Class already registered */ return; ARR_APP1 (type *, supertype->attr.ca.subtypes, clss);