diff options
-rw-r--r-- | llvm/include/llvm/ProfileData/SampleProfWriter.h | 8 | ||||
-rw-r--r-- | llvm/lib/ProfileData/SampleProfReader.cpp | 3 |
2 files changed, 6 insertions, 5 deletions
diff --git a/llvm/include/llvm/ProfileData/SampleProfWriter.h b/llvm/include/llvm/ProfileData/SampleProfWriter.h index ae7ef2deaf0..ce60baf66c6 100644 --- a/llvm/include/llvm/ProfileData/SampleProfWriter.h +++ b/llvm/include/llvm/ProfileData/SampleProfWriter.h @@ -202,10 +202,10 @@ public: private: virtual void initSectionLayout() override { - SectionLayout = {{SecProfSummary}, - {SecNameTable}, - {SecLBRProfile}, - {SecProfileSymbolList}}; + SectionLayout = {{SecProfSummary, 0, 0, 0}, + {SecNameTable, 0, 0, 0}, + {SecLBRProfile, 0, 0, 0}, + {SecProfileSymbolList, 0, 0, 0}}; }; virtual std::error_code writeSections(const StringMap<FunctionSamples> &ProfileMap) override; diff --git a/llvm/lib/ProfileData/SampleProfReader.cpp b/llvm/lib/ProfileData/SampleProfReader.cpp index 075bd9412b0..6d00404b0bb 100644 --- a/llvm/lib/ProfileData/SampleProfReader.cpp +++ b/llvm/lib/ProfileData/SampleProfReader.cpp @@ -530,8 +530,9 @@ std::error_code SampleProfileReaderExtBinaryBase::decompressSection( StringRef CompressedStrings(reinterpret_cast<const char *>(Data), *CompressSize); char *Buffer = Allocator.Allocate<char>(DecompressBufSize); + size_t UCSize = DecompressBufSize; llvm::Error E = - zlib::uncompress(CompressedStrings, Buffer, DecompressBufSize); + zlib::uncompress(CompressedStrings, Buffer, UCSize); if (E) return sampleprof_error::uncompress_failed; DecompressBuf = reinterpret_cast<const uint8_t *>(Buffer); |