From af1fcec2edec0bb2c337dc0e8b348da33683a834 Mon Sep 17 00:00:00 2001 From: jbettis Date: Fri, 10 Feb 2006 21:14:51 +0000 Subject: [PATCH] 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. git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/libobjc/trunk@22463 72102866-910b-0410-8b05-ffd578937521 --- ChangeLog | 6 ++++++ init.c | 6 +++++- 2 files changed, 11 insertions(+), 1 deletion(-) 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); } }