]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
Fixed bug in loading of categories under certain special circumstances
authorNicola Pero <nicola@brainstorm.co.uk>
Mon, 17 Dec 2001 17:23:09 +0000 (17:23 +0000)
committerNicola Pero <nicola@gcc.gnu.org>
Mon, 17 Dec 2001 17:23:09 +0000 (17:23 +0000)
From-SVN: r48110

libobjc/ChangeLog
libobjc/init.c

index 1bce3f81acee17367c4e4febaf3f3618bb97d907..8716284bbfda633d021fa01ddd4ace94e8decc9b 100644 (file)
@@ -1,3 +1,11 @@
+Mon Dec 17 17:02:12 2001  Nicola Pero  <nicola@brainstorm.co.uk>
+
+       * init.c (__objc_exec_class): Fixed bug in the loop on unclaimed
+       categories - when an unclaimed category was found, the loop was
+       doing two steps forward instead of one, so that in certain cases
+       it was failing to properly load all the categories.  (Reported
+       with fix by Alexander Malmberg <alexander@malmberg.org>).
+
 2001-11-14  Aldy Hernandez  <aldyh@redhat.com>
 
         * encoding.c: Add target_flags.
index 29ce6393eb7ca8c67d2c1940dc62b1b98093bcbd..552a74bb5499ca12d77c1ddd8d82d75e5c20be6f 100644 (file)
@@ -599,9 +599,7 @@ __objc_exec_class (Module_t module)
 
   /* Scan the unclaimed category hash.  Attempt to attach any unclaimed
      categories to objects.  */
-  for (cell = &unclaimed_categories;
-       *cell;
-       ({ if (*cell) cell = &(*cell)->tail; }))
+  for (cell = &unclaimed_categories; *cell; )
     {
       Category_t category = (*cell)->head;
       Class class = objc_lookup_class (category->class_name);
@@ -630,6 +628,8 @@ __objc_exec_class (Module_t module)
              only done for root classes. */
           __objc_register_instance_methods_to_class(class);
        }
+      else
+       cell = &(*cell)->tail;
     }
   
   if (unclaimed_proto_list && objc_lookup_class ("Protocol"))