Make sure both protocol classes are available before resolving protocols.

main
theraven 16 years ago
parent 7ac0904a1f
commit 65ec110a61

@ -4,12 +4,6 @@
#include <stdio.h>
#include <string.h>
@implementation Protocol2
+ (void)load
{
objc_clear_class_flag(self, objc_class_flag_plane_aware);
}
@end
@implementation Protocol
+ (void)load
{
@ -22,6 +16,12 @@
return protocol_conformsToProtocol(self, p);
}
@end
@implementation Protocol2
+ (void)load
{
objc_clear_class_flag(self, objc_class_flag_plane_aware);
}
@end
/**
* This class exists for the sole reason that the legacy GNU ABI did not

@ -152,7 +152,7 @@ static BOOL init_protocols(struct objc_protocol_list *protocols)
protocol_class = objc_getClass("Protocol");
protocol_class2 = objc_getClass("Protocol2");
}
if (nil == protocol_class2)
if (nil == protocol_class2 || nil == protocol_class)
{
return NO;
}

Loading…
Cancel
Save