From 1a8dc59306a29843717bd9cad2d57fd0644b890f Mon Sep 17 00:00:00 2001 From: Reid Kleckner Date: Thu, 27 Jul 2017 23:13:05 +0000 Subject: [PATCH] [PDB] Initialize the std::array used for the gsi bitmap With ASan, we would write about 512 bytes of malloc fill value to the PDB, with some random bits ORed in here and there. Dumping the PDB would always fail reliably. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@309331 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/DebugInfo/PDB/Native/PublicsStreamBuilder.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/DebugInfo/PDB/Native/PublicsStreamBuilder.cpp b/lib/DebugInfo/PDB/Native/PublicsStreamBuilder.cpp index 473cdddd2d6..9b807c1653e 100644 --- a/lib/DebugInfo/PDB/Native/PublicsStreamBuilder.cpp +++ b/lib/DebugInfo/PDB/Native/PublicsStreamBuilder.cpp @@ -201,6 +201,8 @@ void GSIHashTableBuilder::addSymbols(ArrayRef Symbols) { // Compute the three tables: the hash records in bucket and chain order, the // bucket presence bitmap, and the bucket chain start offsets. HashRecords.reserve(Symbols.size()); + for (ulittle32_t &Word : HashBitmap) + Word = 0; for (size_t BucketIdx = 0; BucketIdx < IPHR_HASH + 1; ++BucketIdx) { auto &Bucket = TmpBuckets[BucketIdx]; if (Bucket.empty()) -- 2.50.1