From d4aecc52fc58db2f0ea683cc66bda7beeb43181e Mon Sep 17 00:00:00 2001 From: Wei Mi Date: Mon, 7 Oct 2019 16:45:47 +0000 Subject: [PATCH] Fix build errors caused by rL373914. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@373919 91177308-0d34-0410-b5e6-96231b3b80d8 --- include/llvm/ProfileData/SampleProfWriter.h | 8 ++++---- lib/ProfileData/SampleProfReader.cpp | 3 ++- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/include/llvm/ProfileData/SampleProfWriter.h b/include/llvm/ProfileData/SampleProfWriter.h index ae7ef2deaf0..ce60baf66c6 100644 --- a/include/llvm/ProfileData/SampleProfWriter.h +++ b/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 &ProfileMap) override; diff --git a/lib/ProfileData/SampleProfReader.cpp b/lib/ProfileData/SampleProfReader.cpp index 075bd9412b0..6d00404b0bb 100644 --- a/lib/ProfileData/SampleProfReader.cpp +++ b/lib/ProfileData/SampleProfReader.cpp @@ -530,8 +530,9 @@ std::error_code SampleProfileReaderExtBinaryBase::decompressSection( StringRef CompressedStrings(reinterpret_cast(Data), *CompressSize); char *Buffer = Allocator.Allocate(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(Buffer);