Author: labath
Date: Wed Jan 17 06:40:25 2018
New Revision: 322664

URL: http://llvm.org/viewvc/llvm-project?rev=322664&view=rev
Log:
Fix assertion in ObjectFileELF

In D40616 I (mistakenly) assumed that logging an llvm::Error would clear
it. This of course is only true if logging is actually enabled.

This fixes the assertion by manually clearing the error, but it raises
the point of whether we need a special error-clearing logging primitive.

Modified:
    lldb/trunk/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp

Modified: lldb/trunk/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp?rev=322664&r1=322663&r2=322664&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp (original)
+++ lldb/trunk/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp Wed Jan 17 
06:40:25 2018
@@ -3493,6 +3493,7 @@ size_t ObjectFileELF::ReadSectionData(Se
   if (!Decompressor) {
     LLDB_LOG(log, "Unable to initialize decompressor for section {0}: {1}",
              section->GetName(), llvm::toString(Decompressor.takeError()));
+    consumeError(Decompressor.takeError());
     return result;
   }
   auto buffer_sp =
@@ -3502,6 +3503,7 @@ size_t ObjectFileELF::ReadSectionData(Se
            size_t(buffer_sp->GetByteSize())})) {
     LLDB_LOG(log, "Decompression of section {0} failed: {1}",
              section->GetName(), llvm::toString(std::move(Error)));
+    consumeError(std::move(Error));
     return result;
   }
   section_data.SetData(buffer_sp);


_______________________________________________
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

Reply via email to