summaryrefslogtreecommitdiff
path: root/Objective-C
diff options
context:
space:
mode:
authorMatthias Benkard <code@mail.matthias.benkard.de>2007-09-16 02:02:51 +0200
committerMatthias Benkard <code@mail.matthias.benkard.de>2007-09-16 02:02:51 +0200
commita989ea1318574332c31cc48defdbd01f88d74461 (patch)
treeb63e0d98e3c20b128caaaf33bf6ed1a3a12db98e /Objective-C
parent319cdb79ca6ca45c9b2912ead651dffcf35ecbf5 (diff)
PRIMITIVE-INVOKE: Fix a bunch of memory access bugs.
darcs-hash:36acfdc03f4004a971aa31a81b87e40c52940f82
Diffstat (limited to 'Objective-C')
-rw-r--r--Objective-C/libobjcl.m7
1 files changed, 5 insertions, 2 deletions
diff --git a/Objective-C/libobjcl.m b/Objective-C/libobjcl.m
index 4fe4aef..25fc11f 100644
--- a/Objective-C/libobjcl.m
+++ b/Objective-C/libobjcl.m
@@ -281,8 +281,8 @@ objcl_invoke_with_types (int argc,
ffi_type *arg_types[argc + 2];
ffi_status status;
- id receiver = (id) argv[0];
- SEL method_selector = (SEL) argv[1];
+ id receiver = *((id*)argv[0]);
+ SEL method_selector = *((SEL*)argv[1]);
static ffi_type *id_type = NULL;
static ffi_type *sel_type = NULL;
@@ -298,6 +298,9 @@ objcl_invoke_with_types (int argc,
method = class_getInstanceMethod ([receiver class], method_selector)->method_imp;
#else
method = objc_msg_lookup (receiver, method_selector);
+ /* Alternatively:
+ method = [receiver methodForSelector: method_selector];
+ */
#endif
if (method == NULL)