Index: lib/DebugInfo/PDB/Native/TpiStreamBuilder.cpp =================================================================== --- lib/DebugInfo/PDB/Native/TpiStreamBuilder.cpp +++ lib/DebugInfo/PDB/Native/TpiStreamBuilder.cpp @@ -77,7 +77,7 @@ H->HashStreamIndex = HashStreamIndex; H->HashAuxStreamIndex = kInvalidStreamIndex; H->HashKeySize = sizeof(ulittle32_t); - H->NumHashBuckets = MinTpiHashBuckets; + H->NumHashBuckets = MaxTpiHashBuckets - 1; // Recall that hash values go into a completely different stream identified by // the `HashStreamIndex` field of the `TpiStreamHeader`. Therefore, the data @@ -130,7 +130,7 @@ ulittle32_t *H = Allocator.Allocate(TypeHashes.size()); MutableArrayRef HashBuffer(H, TypeHashes.size()); for (uint32_t I = 0; I < TypeHashes.size(); ++I) { - HashBuffer[I] = TypeHashes[I] % MinTpiHashBuckets; + HashBuffer[I] = TypeHashes[I] % (MaxTpiHashBuckets - 1); } ArrayRef Bytes( reinterpret_cast(HashBuffer.data()),