minor bugfix
authorBoris Boesler <boesler@ipd.info.uni-karlsruhe.de>
Wed, 18 Jul 2001 12:12:47 +0000 (12:12 +0000)
committerBoris Boesler <boesler@ipd.info.uni-karlsruhe.de>
Wed, 18 Jul 2001 12:12:47 +0000 (12:12 +0000)
[r242]

ir/tr/type.c

index ad016d4..f8dfbca 100644 (file)
@@ -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);