mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
It is safe to omit the retain/release dance in the reabstraction thunk because we know we have an aditional reference outstanding for the is_escaping verification. The problem with throwing an objc exception inside a noescape closure is that we verify the reference count of the closure sentinel. The reabstraction thunk would increase the reference count call the implementation function that then throws skipping the decrement. rdar://40857699
6 lines
205 B
Objective-C
6 lines
205 B
Objective-C
#import <Foundation/Foundation.h>
|
|
|
|
@interface ExceptionCatcher : NSObject
|
|
- (NSException* _Nullable)tryBlock:(__attribute__((noescape)) void(^ _Nonnull)(void))unsafeBlock NS_SWIFT_NAME(tryBlock(_:));
|
|
@end
|