mirror of
https://github.com/gnustep/libs-base.git
synced 2025-04-22 16:33:29 +00:00
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:
parent
885d703079
commit
5e9e5f7de8
1 changed files with 13 additions and 1 deletions
|
@ -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)
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue