diff --git a/stdlib/public/runtime/Metadata.cpp b/stdlib/public/runtime/Metadata.cpp index 4bcb9ef3ac7d9..b632dfc6f811f 100644 --- a/stdlib/public/runtime/Metadata.cpp +++ b/stdlib/public/runtime/Metadata.cpp @@ -4537,8 +4537,8 @@ WitnessTableCacheEntry::allocate( // Find the allocation. void **fullTable = reinterpret_cast(this + 1); - // Zero out the private storage area. - memset(fullTable, 0, privateSizeInWords * sizeof(void*)); + // Zero out the witness table. + memset(fullTable, 0, getWitnessTableSize(conformance)); // Advance the address point; the private storage area is accessed via // negative offsets.