]> granicus.if.org Git - llvm/commitdiff
Fix build errors caused by rL373914.
authorWei Mi <wmi@google.com>
Mon, 7 Oct 2019 16:45:47 +0000 (16:45 +0000)
committerWei Mi <wmi@google.com>
Mon, 7 Oct 2019 16:45:47 +0000 (16:45 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@373919 91177308-0d34-0410-b5e6-96231b3b80d8

include/llvm/ProfileData/SampleProfWriter.h
lib/ProfileData/SampleProfReader.cpp

index ae7ef2deaf05970d3d2fef526b5acb76da72cb85..ce60baf66c65c9cc3216bf2727a75ab754fabfff 100644 (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;
index 075bd9412b0c9a8e983b6ef0152363a3b2213d3e..6d00404b0bb22b36deaeb32532f30a0370c38582 100644 (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);