Fixup to get correct type information when handling an incoming message as

suggested by Fred.


git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@33832 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Richard Frith-MacDonald 2011-09-12 16:03:07 +00:00
parent 4baaff38cb
commit 9e8187eebf
2 changed files with 11 additions and 27 deletions

View file

@ -1,3 +1,9 @@
2011-09-12 Richard Frith-Macdonald <rfm@gnu.org>
* Source/NSConnection.m: When getting the local type information for
comparison with that supplied by the remote system, do so by sending
-methodSignatureForSelector: to the receiver of the message.
2011-09-07 Richard Frith-Macdonald <rfm@gnu.org>
* Source/GSFFIInvocation.m: Check that we have a typed selector

View file

@ -2509,7 +2509,6 @@ static NSLock *cached_proxies_gate = nil;
id tmp;
id object;
SEL selector;
GSMethod meth = 0;
BOOL is_exception = NO;
unsigned flags;
int argnum;
@ -2567,35 +2566,15 @@ static NSLock *cached_proxies_gate = nil;
as the ENCODED_TYPES string, but it will have different register
and stack locations if the ENCODED_TYPES came from a machine of a
different architecture. */
if (GSObjCIsClass(object))
{
meth = GSGetMethod(object, selector, NO, YES);
}
else if (GSObjCIsInstance(object))
{
meth = GSGetMethod(object_getClass(object), selector, YES, YES);
}
else
sig = [object methodSignatureForSelector: selector];
if (nil == sig)
{
[NSException raise: NSInvalidArgumentException
format: @"decoded object %p is invalid", object];
format: @"decoded object %p doesn't handle %s",
object, sel_getName(selector)];
}
type = [sig methodType];
if (meth != 0)
{
type = method_getTypeEncoding(meth);
}
else
{
NSDebugLog(@"Local object <%p %s> doesn't implement: %s directly. "
@"Will search for arbitrary signature.",
object,
class_getName(GSObjCIsClass(object)
? object : (id)object_getClass(object)),
sel_getName(selector));
type = GSTypesFromSelector(selector);
}
/* Make sure we successfully got the method type, and that its
types match the ENCODED_TYPES. */
NSCParameterAssert (type);
@ -2606,7 +2585,6 @@ static NSLock *cached_proxies_gate = nil;
encoded_types, type, sel_getName(selector)];
}
sig = [NSMethodSignature signatureWithObjCTypes: type];
inv = [[NSInvocation alloc] initWithMethodSignature: sig];
tmptype = skip_argspec (type);