Hello again,

I just stumbled upon a little bug in ETGetSuperclass() (from
NSObject+Etoile.m). If you were trying to resolve the superclass of a
root class, objc_lookup_class() would be called with NULL as an
argument, resulting in a crash. In the attached patch this is fixed for
the GNU runtime. I'm not sure if other runtimes need similar treatment.

Cheers,


Niels
Index: Frameworks/EtoileFoundation/Source/NSObject+Etoile.m
===================================================================
--- Frameworks/EtoileFoundation/Source/NSObject+Etoile.m	(revision 4786)
+++ Frameworks/EtoileFoundation/Source/NSObject+Etoile.m	(working copy)
@@ -53,7 +53,14 @@
 	}
 	else
 	{
-		return objc_lookup_class((char*)aClass->super_class);
+		if (aClass->super_class != NULL)
+		{
+			return objc_lookup_class((char*)aClass->super_class);
+		}
+		else
+		{
+			return Nil;
+		}
 	}
 #elif defined(GNUSTEP_RUNTIME_COMPATIBILITY)
 	return GSObjCSuper(aClass);
_______________________________________________
Etoile-dev mailing list
Etoile-dev@gna.org
https://mail.gna.org/listinfo/etoile-dev

Reply via email to