From 283df8cf742803ad0946dbb2b4ff1e9d1eaed7aa 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. llvm-svn: 373919 --- llvm/include/llvm/ProfileData/SampleProfWriter.h | 8 ++++---- 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 ae7ef2d..ce60baf 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 &ProfileMap) override; diff --git a/llvm/lib/ProfileData/SampleProfReader.cpp b/llvm/lib/ProfileData/SampleProfReader.cpp index 075bd94..6d00404 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(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); -- 2.7.4