diff --git a/ChangeLog b/ChangeLog index 697f849..385e3a7 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2006-02-10 Jeremy Bettis + + * init.c (objc_init_statics, __objc_init_protocols): Fix to GCC bug 23214 + (http://gcc.gnu.org/bugzilla/show_bug.cgi?id=23214) In some odd circumstances + protocols are not properly initalized. See the Bugzilla page for testcase. + 2006-02-10 Jeremy Bettis * thr-win32.c: There is no such define __MINGW__, changed to __MINGW32__ diff --git a/init.c b/init.c index 91f4ae8..3387865 100644 --- a/init.c +++ b/init.c @@ -460,7 +460,8 @@ objc_init_statics (void) haven't been here before. However, the comparison is to be reminded of taking into account class posing and to think about possible semantics... */ - else if (class != statics->instances[0]->class_pointer) +/* Due to a compiler bug, sometimes statics->instances[0]->class_pointer == class but statics->instances[1]->class_pointer == NULL */ + else { id *inst; @@ -875,6 +876,9 @@ __objc_init_protocols (struct objc_protocol_list *protos) (int) ((char *) protos->list[i]->class_pointer - (char *) 0), PROTOCOL_VERSION); + } else { + /* even if the protocol is initialized, the super protos might not be */ + __objc_init_protocols (aProto->protocol_list); } }