summaryrefslogtreecommitdiffstats
path: root/libobjc
diff options
context:
space:
mode:
authornicola <nicola@138bc75d-0d04-0410-961f-82ee72b054a4>2010-11-23 19:20:54 +0000
committernicola <nicola@138bc75d-0d04-0410-961f-82ee72b054a4>2010-11-23 19:20:54 +0000
commit3a247cc40395ebb31e31f77c87e3c269976fe34a (patch)
tree29120b11734cf60bf7cc31ce44706094b8da7bfe /libobjc
parent280f864980a12f1b7b03bedaacd1d1ac4ce314ea (diff)
downloadppe42-gcc-3a247cc40395ebb31e31f77c87e3c269976fe34a.tar.gz
ppe42-gcc-3a247cc40395ebb31e31f77c87e3c269976fe34a.zip
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. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@167092 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libobjc')
-rw-r--r--libobjc/ChangeLog6
-rw-r--r--libobjc/sendmsg.c9
2 files changed, 13 insertions, 2 deletions
diff --git a/libobjc/ChangeLog b/libobjc/ChangeLog
index 02be0ebd0e8..08e74a8405e 100644
--- a/libobjc/ChangeLog
+++ b/libobjc/ChangeLog
@@ -1,3 +1,9 @@
+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.
+
2010-11-18 Nicola Pero <nicola.pero@meta-innovation.com>
* ivars.c: Include stdlib.h.
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);
}
}
}
OpenPOWER on IntegriCloud