Don't infinite loop when trying to send an unimplemented message to an object that doesn't implement -methodSignatureForSelector:

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@30593 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
David Chisnall 2010-06-07 00:28:52 +00:00
parent 885d703079
commit 5e9e5f7de8

View file

@ -147,7 +147,19 @@ static IMP gs_objc_msg_forward2 (id receiver, SEL sel)
NSMethodSignature *sig;
GSCodeBuffer *memory;
sig = [receiver methodSignatureForSelector: sel];
if (class_respondsToSelector(receiver->isa, sel))
{
sig = [receiver methodSignatureForSelector: sel];
}
else
{
[NSException raise: NSInvalidArgumentException
format: @"GSFFIInvocation: Class '%s'(%s) does not respond"
@" to forwardInvocation: for '%s'",
GSClassNameFromObject(receiver),
GSObjCIsInstance(receiver) ? "instance" : "class",
sel ? sel_getName(sel) : "(null)"];
}
if (sig == nil)
{