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 {
410410 StoredPointer InstanceAddress =
411411 InstanceMetadataAddressAddress + 2 * sizeof (StoredPointer);
412412
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+
413418 // Round up to alignment, and we have the start address of the
414419 // instance payload.
415420 auto AlignmentMask = VWT->getAlignmentMask ();
416- auto Offset = (sizeof (HeapObject) + AlignmentMask) & ~AlignmentMask;
417- InstanceAddress += Offset;
421+ InstanceAddress = (InstanceAddress + AlignmentMask) & ~AlignmentMask;
418422
419423 return RemoteExistential (
420424 RemoteAddress (*InstanceMetadataAddress),
You can’t perform that action at this time.
0 commit comments