diff --git a/runtime.c b/runtime.c index 55cdd23..0fa10d8 100644 --- a/runtime.c +++ b/runtime.c @@ -425,6 +425,12 @@ IMP class_replaceMethod(Class cls, SEL name, IMP imp, const char *types) } IMP old = (IMP)method->method_imp; method->method_imp = (objc_imp_gnu)imp; + + if (CLS_ISRESOLV(cls)) + { + __objc_update_dispatch_table_for_class(cls); + } + return old; } @@ -820,6 +826,14 @@ static id objectNew(id cls) return newIMP((id)cls, newSel); } +Protocol *objc_getProtocol(const char *name) +{ + // Protocols are not centrally registered in the GNU runtime. + Protocol *protocol = (Protocol*)(objectNew(objc_getClass("Protocol"))); + protocol->protocol_name = (char*)name; + return protocol; +} + BOOL protocol_conformsToProtocol(Protocol *p, Protocol *other) { return NO;