Fix 32-bit builds broken by 320813
authorPavel Labath <labath@google.com>
Fri, 15 Dec 2017 14:39:12 +0000 (14:39 +0000)
committerPavel Labath <labath@google.com>
Fri, 15 Dec 2017 14:39:12 +0000 (14:39 +0000)
cast to size_t to avoid narrowing error.

llvm-svn: 320816

lldb/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp

index 9869a94f06b0bda02506366a301b8779b275e0c5..17d892450e4dee7081c7cbff082da8b72553c82e 100644 (file)
@@ -3496,7 +3496,7 @@ size_t ObjectFileELF::ReadSectionData(Section *section,
   auto Decompressor = llvm::object::Decompressor::create(
       section->GetName().GetStringRef(),
       {reinterpret_cast<const char *>(section_data.GetDataStart()),
-       section_data.GetByteSize()},
+       size_t(section_data.GetByteSize())},
       GetByteOrder() == eByteOrderLittle, GetAddressByteSize() == 8);
   if (!Decompressor) {
     LLDB_LOG(log, "Unable to initialize decompressor for section {0}: {1}",
@@ -3507,7 +3507,7 @@ size_t ObjectFileELF::ReadSectionData(Section *section,
       std::make_shared<DataBufferHeap>(Decompressor->getDecompressedSize(), 0);
   if (auto Error = Decompressor->decompress(
           {reinterpret_cast<char *>(buffer_sp->GetBytes()),
-           buffer_sp->GetByteSize()})) {
+           size_t(buffer_sp->GetByteSize())})) {
     LLDB_LOG(log, "Decompression of section {0} failed: {1}",
              section->GetName(), llvm::toString(std::move(Error)));
     return result;