Back-ported fix in Method lookup from libobjc2 to ObjectiveC2. Should fix the DO-related issues (failure to connect to gdnc and so on).

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@30409 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
theraven 2010-05-17 13:36:00 +00:00
parent 41bf8937ab
commit 8085cfb1c6

View file

@ -103,8 +103,6 @@ static Method
class_getInstanceMethodNonrecursive(Class aClass, SEL aSelector)
{
struct objc_method_list *methods;
const char *name = sel_get_name(aSelector);
const char *types = sel_get_type(aSelector);
for (methods = aClass->methods;
methods != NULL; methods = methods->method_next)
@ -115,16 +113,10 @@ class_getInstanceMethodNonrecursive(Class aClass, SEL aSelector)
{
Method_t method = &methods->method_list[i];
if (strcmp(sel_get_name(method->method_name), name) == 0)
{
if (NULL == types || strcmp(types, method->method_types) == 0)
if (method->method_name->sel_id == aSelector->sel_id)
{
return method;
}
// Return NULL if the method exists with this name but has the
// wrong types
return NULL;
}
}
}
return NULL;