Fixes the swizzling crash (#1943)

Summary:
This fixes the issue mentioned in https://github.com/facebook/flipper/issues/1940

## Changelog

Pull Request resolved: https://github.com/facebook/flipper/pull/1943

Test Plan: User confirmed

Reviewed By: mweststrate

Differential Revision: D26577560

Pulled By: priteshrnandgaonkar

fbshipit-source-id: dec4e34dcec4a3b3c20c11f0f2dc748fe2698693
This commit is contained in:
Pritesh Nandgaonkar
2021-02-22 05:51:13 -08:00
committed by Facebook GitHub Bot
parent adfc6e4f99
commit c87a581747

View File

@@ -91,6 +91,8 @@
class_addMethod(cls, swizzledSelector, implementation, description->types); class_addMethod(cls, swizzledSelector, implementation, description->types);
Method newMethod = class_getInstanceMethod(cls, swizzledSelector); Method newMethod = class_getInstanceMethod(cls, swizzledSelector);
method_exchangeImplementations(oldMethod, newMethod); method_exchangeImplementations(oldMethod, newMethod);
} else {
class_addMethod(cls, selector, implementation, methodDescription.types);
} }
} }