From a989ea1318574332c31cc48defdbd01f88d74461 Mon Sep 17 00:00:00 2001 From: Matthias Benkard Date: Sun, 16 Sep 2007 02:02:51 +0200 Subject: PRIMITIVE-INVOKE: Fix a bunch of memory access bugs. darcs-hash:36acfdc03f4004a971aa31a81b87e40c52940f82 --- Objective-C/libobjcl.m | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'Objective-C') 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) -- cgit v1.2.3