瀏覽代碼

Don't call other methods on target in performSelector:

Tanner Bennett 6 年之前
父節點
當前提交
9645811baa
共有 1 個文件被更改,包括 10 次插入1 次删除
  1. 10 1
      Classes/Utility/Runtime/FLEXRuntimeUtility.m

+ 10 - 1
Classes/Utility/Runtime/FLEXRuntimeUtility.m

@@ -297,6 +297,16 @@ const unsigned int kFLEXNumberOfImplicitArgs = 2;
         return nil;
         return nil;
     }
     }
 
 
+    NSMethodSignature *methodSignature = [NSMethodSignature signatureWithObjCTypes:({
+        Method method;
+        if (object_isClass(object)) {
+            method = class_getClassMethod(object, selector);
+        } else {
+            method = class_getInstanceMethod(object_getClass(object), selector);
+        }
+        method_getTypeEncoding(method);
+    })];
+    
     // Probably an unsupported type encoding, like bitfields.
     // Probably an unsupported type encoding, like bitfields.
     // In the future, we could calculate the return length
     // In the future, we could calculate the return length
     // on our own. For now, we abort.
     // on our own. For now, we abort.
@@ -305,7 +315,6 @@ const unsigned int kFLEXNumberOfImplicitArgs = 2;
     // NSMethodSignature will convert {?=b8b4b1b1b18[8S]} to {?}
     // NSMethodSignature will convert {?=b8b4b1b1b18[8S]} to {?}
     //
     //
     // returnType = method_getTypeEncoding(class_getInstanceMethod([object class], selector));
     // returnType = method_getTypeEncoding(class_getInstanceMethod([object class], selector));
-    NSMethodSignature *methodSignature = [object methodSignatureForSelector:selector];
     if (!methodSignature.methodReturnLength &&
     if (!methodSignature.methodReturnLength &&
         methodSignature.methodReturnType[0] != FLEXTypeEncodingVoid) {
         methodSignature.methodReturnType[0] != FLEXTypeEncodingVoid) {
         return nil;
         return nil;