diff --git a/runtime.c b/runtime.c index f2da7ed..20cb302 100644 --- a/runtime.c +++ b/runtime.c @@ -749,7 +749,9 @@ Class objc_allocateClassPair(Class superclass, const char *name, size_t extraByt // Set up the new class newClass->class_pointer = metaClass; - newClass->super_class = superclass; + // Set the superclass pointer to the name. The runtime will fix this when + // the class links are resolved. + newClass->super_class = superclass->name; newClass->name = strdup(name); newClass->info = _CLS_CLASS | _CLS_RUNTIME | _CLS_NEW_ABI; newClass->dtable = __objc_uninstalled_dtable;