mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
MetadataReader: Add support for NSError toll-free bridging
An Error existential value can directly store a reference to an NSError instance without wrapping it in an Error container. When "projecting" such an existential, the dynamic type is the NSError's isa pointer, and the payload is the address of the instance itself.
This commit is contained in:
@@ -500,8 +500,10 @@ public:
|
||||
Reader.readMetadataAndValueErrorExistential(RemoteAddress(*pointerval));
|
||||
if (!result)
|
||||
return getFailure<std::pair<Type, RemoteAddress>>();
|
||||
RemoteAddress metadataAddress = result->first;
|
||||
RemoteAddress valueAddress = result->second;
|
||||
|
||||
RemoteAddress metadataAddress = std::get<0>(*result);
|
||||
RemoteAddress valueAddress = std::get<1>(*result);
|
||||
bool isBridged = std::get<2>(*result);
|
||||
|
||||
auto typeResult =
|
||||
Reader.readTypeFromMetadata(metadataAddress.getAddressData());
|
||||
|
||||
Reference in New Issue
Block a user