Skip to content

Commit 30491e6

Browse files
authored
Merge pull request swiftlang#32370 from DougGregor/witness-table-instantiation-default-zeroing-5.3
[5.3] [Runtime] Zero out the entire witness table during instantiation.
2 parents 5729d2f + 0f1439c commit 30491e6

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

stdlib/public/runtime/Metadata.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4536,8 +4536,8 @@ WitnessTableCacheEntry::allocate(
45364536
// Find the allocation.
45374537
void **fullTable = reinterpret_cast<void**>(this + 1);
45384538

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

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

0 commit comments

Comments
 (0)