File tree Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -410,11 +410,15 @@ class MetadataReader {
410
410
StoredPointer InstanceAddress =
411
411
InstanceMetadataAddressAddress + 2 * sizeof (StoredPointer);
412
412
413
+ // When built with Objective-C interop, the runtime also stores a conformance
414
+ // to Hashable and the base type introducing the Hashable conformance.
415
+ if (isObjC)
416
+ InstanceAddress += 2 * sizeof (StoredPointer);
417
+
413
418
// Round up to alignment, and we have the start address of the
414
419
// instance payload.
415
420
auto AlignmentMask = VWT->getAlignmentMask ();
416
- auto Offset = (sizeof (HeapObject) + AlignmentMask) & ~AlignmentMask;
417
- InstanceAddress += Offset;
421
+ InstanceAddress = (InstanceAddress + AlignmentMask) & ~AlignmentMask;
418
422
419
423
return RemoteExistential (
420
424
RemoteAddress (*InstanceMetadataAddress),
You can’t perform that action at this time.
0 commit comments