mirror of
https://github.com/gnustep/libs-base.git
synced 2025-06-01 17:12:03 +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
a220e13b83
commit
dd9e1a4611
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;
|
NSMethodSignature *sig;
|
||||||
GSCodeBuffer *memory;
|
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)
|
if (sig == nil)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue