diff options
author | Richard Frith-Macdonald <rfm@gnu.org> | 2010-11-23 19:20:54 +0000 |
---|---|---|
committer | Nicola Pero <nicola@gcc.gnu.org> | 2010-11-23 19:20:54 +0000 |
commit | d81e30b8d3f683e92f462a86bef5333b936998a2 (patch) | |
tree | 29120b11734cf60bf7cc31ce44706094b8da7bfe /libobjc/sendmsg.c | |
parent | 9a37bc079dd8e0d3d649b5e38464a5e5977d7baa (diff) | |
download | gcc-d81e30b8d3f683e92f462a86bef5333b936998a2.tar.gz |
In libobjc/: 2010-11-23 Richard Frith-Macdonald <rfm@gnu.org>
In libobjc/:
2010-11-23 Richard Frith-Macdonald <rfm@gnu.org>
* sendmsg.c (get_imp): Fixed call to __objc_get_forward_imp to
pass nil as the receiver since we don't know the receiver at this
point.
From-SVN: r167092
Diffstat (limited to 'libobjc/sendmsg.c')
-rw-r--r-- | libobjc/sendmsg.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/libobjc/sendmsg.c b/libobjc/sendmsg.c index ee1f0a36150..7f7024c275a 100644 --- a/libobjc/sendmsg.c +++ b/libobjc/sendmsg.c @@ -189,8 +189,13 @@ get_imp (Class class, SEL sel) /* The dispatch table has been installed, and the method is not in the dispatch table. So the method just doesn't exist for the class. Return the forwarding - implementation. */ - res = __objc_get_forward_imp ((id)class, sel); + implementation. We don't know the receiver (only its + class), so we have to pass 'nil' as the first + argument. Passing the class as first argument is + wrong because the class is not the receiver; it can + result in us calling a class method when we want an + instance method of the same name. */ + res = __objc_get_forward_imp (nil, sel); } } } |