Skip to content

Commit 7c80051

Browse files
authored
Merge pull request #41221 from apple/compnerd/padding
Reflection: correct conformance table iteration
2 parents d295733 + ff7ba2a commit 7c80051

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

include/swift/Reflection/ReflectionContext.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1157,15 +1157,15 @@ class ReflectionContext
11571157
reinterpret_cast<const ConcurrentHashMap<Runtime> *>(MapBytes.get());
11581158

11591159
auto Count = MapData->ElementCount;
1160-
auto Size = Count * sizeof(ConformanceCacheEntry<Runtime>);
1160+
auto Size = Count * sizeof(ConformanceCacheEntry<Runtime>) + sizeof(StoredPointer);
11611161

11621162
auto ElementsBytes =
11631163
getReader().readBytes(RemoteAddress(MapData->Elements), Size);
11641164
if (!ElementsBytes)
11651165
return;
11661166
auto ElementsData =
11671167
reinterpret_cast<const ConformanceCacheEntry<Runtime> *>(
1168-
ElementsBytes.get());
1168+
reinterpret_cast<const char *>(ElementsBytes.get()) + sizeof(StoredPointer));
11691169

11701170
for (StoredSize i = 0; i < Count; i++) {
11711171
auto &Element = ElementsData[i];

0 commit comments

Comments
 (0)