Skip to content

Commit 406d03b

Browse files
authored
Merge pull request swiftlang#27974 from Catfish-Man/erroneous-errors
Don't try to speculatively bridge tagged pointers to Errors
2 parents 2696b96 + acb5b57 commit 406d03b

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

stdlib/public/runtime/ErrorObject.mm

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -512,7 +512,8 @@ id _swift_stdlib_getErrorDefaultUserInfo(OpaqueValue *error,
512512
Class NSErrorClass = getNSErrorClass();
513513

514514
// The object must be an NSError subclass.
515-
if (![reinterpret_cast<id>(object) isKindOfClass: NSErrorClass])
515+
if (isObjCTaggedPointerOrNull(object) ||
516+
![reinterpret_cast<id>(object) isKindOfClass: NSErrorClass])
516517
return false;
517518

518519
id srcInstance = reinterpret_cast<id>(object);

0 commit comments

Comments
 (0)