File tree Expand file tree Collapse file tree 2 files changed +14
-19
lines changed Expand file tree Collapse file tree 2 files changed +14
-19
lines changed Original file line number Diff line number Diff line change @@ -361,24 +361,21 @@ class MetadataReader {
361
361
bool isObjC = false ;
362
362
bool isBridged = false ;
363
363
364
- // If we can determine the Objective-C class name, this is probably an
365
- // error existential with NSError-compatible layout.
366
- std::string ObjCClassName;
367
- if (readObjCClassName (*MetadataAddress, ObjCClassName)) {
368
- if (ObjCClassName == " __SwiftNativeNSError" )
369
- isObjC = true ;
370
- else
364
+ auto Meta = readMetadata (*MetadataAddress);
365
+ if (auto ClassMeta = dyn_cast<TargetClassMetadata<Runtime>>(Meta)) {
366
+ if (ClassMeta->isPureObjC ()) {
367
+ // If we can determine the Objective-C class name, this is probably an
368
+ // error existential with NSError-compatible layout.
369
+ std::string ObjCClassName;
370
+ if (readObjCClassName (*MetadataAddress, ObjCClassName)) {
371
+ if (ObjCClassName == " __SwiftNativeNSError" )
372
+ isObjC = true ;
373
+ else
374
+ isBridged = true ;
375
+ }
376
+ } else {
371
377
isBridged = true ;
372
- } else {
373
- // Otherwise, we can check to see if this is a class metadata with the
374
- // kind value's least significant bit set, which indicates a pure
375
- // Swift class.
376
- auto Meta = readMetadata (*MetadataAddress);
377
- auto ClassMeta = dyn_cast<TargetClassMetadata<Runtime>>(Meta);
378
- if (!ClassMeta)
379
- return None;
380
-
381
- isObjC = ClassMeta->isPureObjC ();
378
+ }
382
379
}
383
380
384
381
if (isBridged) {
Original file line number Diff line number Diff line change 1
- // UNSUPPORTED: linux
2
- // <rdar://problem/42793848>
3
1
// RUN: %target-swift-remoteast-test %s | %FileCheck %s
4
2
5
3
// REQUIRES: swift-remoteast-test
You can’t perform that action at this time.
0 commit comments