Fixed class_get_super_class() so that it actually works and simplified class_getSuperclass() to call it directly. This fixes numerous other corner cases, for example you can now throw a constant string as an exception and have it work correctly even if no constant string objects have been sent messages.

Hopefully this will fix a few other Heisenbugs and reduce the strength of the Mottola Effect.
main
theraven 16 years ago
parent 202006f6b8
commit 2a5ba9f18a

@ -550,7 +550,16 @@ class_get_meta_class(Class _class)
static inline Class
class_get_super_class(Class _class)
{
return CLS_ISCLASS(_class)?_class->super_class:Nil;
void __objc_resolve_class_links(void);
if CLS_ISCLASS(_class)
{
if (!CLS_ISRESOLV(_class))
{
__objc_resolve_class_links();
}
return _class->super_class;
}
return Nil;
}
static inline int

@ -397,10 +397,6 @@ const char * class_getName(Class cls)
void __objc_resolve_class_links(void);
Class class_getSuperclass(Class cls)
{
if (!CLS_ISRESOLV(cls))
{
__objc_resolve_class_links();
}
return class_get_super_class(cls);
}

Loading…
Cancel
Save