Fix build errors caused by rL373914.

llvm-svn: 373919
This commit is contained in:
Wei Mi 2019-10-07 16:45:47 +00:00
parent f016ffed52
commit b8f1a4e11b
2 changed files with 6 additions and 5 deletions

View File

@ -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;

View File

@ -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);