Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

check whether instance method is registered also with OS X 10.7. fix …

…#1476
  • Loading branch information...
commit 34c0f63b0bc275f81c4e1c74909c5d2df5b49410 1 parent cbbeab8
@Watson1978 Watson1978 authored
Showing with 4 additions and 2 deletions.
  1. +4 −2 dispatcher.cpp
View
6 dispatcher.cpp
@@ -674,18 +674,20 @@ rb_vm_dispatch(void *_vm, struct mcache *cache, VALUE top, VALUE self,
if ((opt & DISPATCH_SUPER) == 0
&& rb_objc_supports_forwarding(self, sel)) {
-#if MAC_OS_X_VERSION_MAX_ALLOWED < 1070
+//#if MAC_OS_X_VERSION_MAX_ALLOWED < 1070
// In earlier versions of the Objective-C runtime, there seems
// to be a bug where class_getInstanceMethod isn't atomic,
// and might return NULL while at the exact same time another
// thread registers the related method.
// As a work-around, we double-check if the method still does
// not exist here. If he does, we can dispatch it properly.
+
+ // note: OS X 10.7 also, this workaround is required. see #1476
method = class_getInstanceMethod(klass, sel);
if (method != NULL) {
goto recache2;
}
-#endif
+//#endif
fill_ocache(cache, self, klass, (IMP)objc_msgSend, sel, NULL,
argc);
goto dispatch;

1 comment on commit 34c0f63

@alloy
Owner

You are the man! :dancers:

Please sign in to comment.
Something went wrong with that request. Please try again.