mirror of
https://github.com/gnustep/libs-base.git
synced 2025-05-31 08:41:03 +00:00
Quick runtime fix
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@17099 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
a9a9958dfd
commit
2f6c120a86
2 changed files with 67 additions and 0 deletions
|
@ -9,6 +9,7 @@ Fri Jul 4 11:09:37 2003 Nicola Pero <n.pero@mi.flashnet.it>
|
||||||
* Source/NSObject.m: ([methodSignatureForSelector:]) modified to take
|
* Source/NSObject.m: ([methodSignatureForSelector:]) modified to take
|
||||||
into account any protocols that the receiver conforms to, so the
|
into account any protocols that the receiver conforms to, so the
|
||||||
returned signature has the fullest possible type information.
|
returned signature has the fullest possible type information.
|
||||||
|
Category Protocol(Fixup) ... evil hack to work around runtime bug.
|
||||||
* Source/GSFFCallInvocation.m: Fetch method signature from receiver
|
* Source/GSFFCallInvocation.m: Fetch method signature from receiver
|
||||||
in preference to using other info. Ensures we have correct info for
|
in preference to using other info. Ensures we have correct info for
|
||||||
the object we are sending the message to.
|
the object we are sending the message to.
|
||||||
|
|
|
@ -687,6 +687,72 @@ static IMP autorelease_imp;
|
||||||
static BOOL double_release_check_enabled = NO;
|
static BOOL double_release_check_enabled = NO;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@implementation Protocol (Fixup)
|
||||||
|
struct objc_method_description_list {
|
||||||
|
int count;
|
||||||
|
struct objc_method_description list[1];
|
||||||
|
};
|
||||||
|
|
||||||
|
- (struct objc_method_description *) descriptionForInstanceMethod:(SEL)aSel
|
||||||
|
{
|
||||||
|
int i;
|
||||||
|
struct objc_protocol_list* proto_list;
|
||||||
|
const char* name = sel_get_name (aSel);
|
||||||
|
struct objc_method_description *result;
|
||||||
|
|
||||||
|
if (instance_methods != 0)
|
||||||
|
{
|
||||||
|
for (i = 0; i < instance_methods->count; i++)
|
||||||
|
{
|
||||||
|
if (!strcmp ((char*)instance_methods->list[i].name, name))
|
||||||
|
return &(instance_methods->list[i]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
for (proto_list = protocol_list; proto_list; proto_list = proto_list->next)
|
||||||
|
{
|
||||||
|
size_t j;
|
||||||
|
for (j=0; j < proto_list->count; j++)
|
||||||
|
{
|
||||||
|
if ((result = [proto_list->list[j]
|
||||||
|
descriptionForInstanceMethod: aSel]))
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
|
||||||
|
- (struct objc_method_description *) descriptionForClassMethod:(SEL)aSel;
|
||||||
|
{
|
||||||
|
int i;
|
||||||
|
struct objc_protocol_list* proto_list;
|
||||||
|
const char* name = sel_get_name (aSel);
|
||||||
|
struct objc_method_description *result;
|
||||||
|
|
||||||
|
if (class_methods != 0)
|
||||||
|
{
|
||||||
|
for (i = 0; i < class_methods->count; i++)
|
||||||
|
{
|
||||||
|
if (!strcmp ((char*)class_methods->list[i].name, name))
|
||||||
|
return &(class_methods->list[i]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
for (proto_list = protocol_list; proto_list; proto_list = proto_list->next)
|
||||||
|
{
|
||||||
|
size_t j;
|
||||||
|
for (j=0; j < proto_list->count; j++)
|
||||||
|
{
|
||||||
|
if ((result = [proto_list->list[j]
|
||||||
|
descriptionForClassMethod: aSel]))
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
|
||||||
|
@end
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* <p>
|
* <p>
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue