Fix the size of run-time generated root classes.

The size of the new class with should be sizeof(Class), not sizeof(struct objc_class).
main
David Chisnall 10 years ago
parent d3bcc30e92
commit 53bc9f3892

@ -15,6 +15,8 @@ int main()
{
Class a, b, c, d, e;
assert(class_getInstanceSize(objc_allocateClassPair(Nil, "Empty", 0)) == sizeof(Class));
a = objc_allocateClassPair([Test class], "A", 0);
a = objc_allocateClassPair([Test class], "A", 0);
objc_registerClassPair(a);

@ -726,7 +726,7 @@ Class objc_allocateClassPair(Class superclass, const char *name, size_t extraByt
if (Nil == superclass)
{
newClass->instance_size = sizeof(struct objc_class);
newClass->instance_size = sizeof(struct objc_class*);
}
else
{

Loading…
Cancel
Save