Attempt workaround for runtime providing insufficient information in callback.

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@33814 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Richard Frith-MacDonald 2011-09-07 09:42:50 +00:00
parent fcf071b0b7
commit 4baaff38cb
2 changed files with 17 additions and 1 deletions

View file

@ -1,3 +1,11 @@
2011-09-07 Richard Frith-Macdonald <rfm@gnu.org>
* Source/GSFFIInvocation.m: Check that we have a typed selector
during invocation (copy types from method signature if necessary)
so that forwarding won't fail if the runtime does a callback to
us without providing the receiver for us to check ... workaround
for proxying issues with very old runtimes.
2011-08-27 Richard Frith-Macdonald <rfm@gnu.org>
* Source/NSLock.m: Fix bug #34154 ... logic error locking before date.

View file

@ -433,7 +433,14 @@ GSFFIInvokeWithTargetAndImp(NSInvocation *inv, id anObject, IMP imp)
return;
}
/* Make sure we have a typed selector for forwarding.
*/
NSAssert(_selector != 0, @"you must set the selector before invoking");
if (0 == GSTypesFromSelector(_selector))
{
_selector = GSSelectorFromNameAndTypes(sel_getName(_selector),
[_sig methodType]);
}
/*
* Temporarily set new target and copy it (and the selector) into the
@ -560,7 +567,8 @@ GSFFIInvocationCallback(ffi_cif *cif, void *retp, void **args, void *user)
sig = nil;
if (gs_protocol_selector(GSTypesFromSelector(selector)) == YES)
{
sig = [NSMethodSignature signatureWithObjCTypes: GSTypesFromSelector(selector)];
sig = [NSMethodSignature signatureWithObjCTypes:
GSTypesFromSelector(selector)];
}
if (sig == nil)
{