Skip to content

Commit 26f7823

Browse files
authored
Merge pull request swiftlang#32367 from DougGregor/witness-table-instantiation-default-zeroing
[Runtime] Zero out the entire witness table during instantiation.
2 parents 16c9c00 + 7d7a35e commit 26f7823

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

stdlib/public/runtime/Metadata.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -4537,8 +4537,8 @@ WitnessTableCacheEntry::allocate(
45374537
// Find the allocation.
45384538
void **fullTable = reinterpret_cast<void**>(this + 1);
45394539

4540-
// Zero out the private storage area.
4541-
memset(fullTable, 0, privateSizeInWords * sizeof(void*));
4540+
// Zero out the witness table.
4541+
memset(fullTable, 0, getWitnessTableSize(conformance));
45424542

45434543
// Advance the address point; the private storage area is accessed via
45444544
// negative offsets.

0 commit comments

Comments
 (0)