diff options
author | Stefan Gränitz <weliveindetail@users.noreply.github.com> | 2023-11-01 12:09:12 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-11-01 12:09:12 +0100 |
commit | 43db8ac8ae56f24b5c06e9edb194fe1b7e9cbda0 (patch) | |
tree | 786d24d80ce4e2232aaf02b4a7c7e8321557ad0f /lldb/source/Plugins/ObjectFile/PECOFF/ObjectFilePECOFF.cpp | |
parent | 4a7702b785809a0dcd8a38bf7cbdd8181427c716 (diff) | |
download | llvm-43db8ac8ae56f24b5c06e9edb194fe1b7e9cbda0.zip llvm-43db8ac8ae56f24b5c06e9edb194fe1b7e9cbda0.tar.gz llvm-43db8ac8ae56f24b5c06e9edb194fe1b7e9cbda0.tar.bz2 |
[lldb] Fix missing comsumeError() with LLDB_LOG in ObjectFileCOFF/PECOFF (#70793)
All `llvm::Error`s must be checked/consumed before destruction. Previously,
the errors in this patch were only consumed when logging was enabled.
Using `LLDB_LOG_ERROR` instead of `LLDB_LOG` fixes that, because it
calls `llvm::consumeError()` explicitly when logging is disabled.
Diffstat (limited to 'lldb/source/Plugins/ObjectFile/PECOFF/ObjectFilePECOFF.cpp')
-rw-r--r-- | lldb/source/Plugins/ObjectFile/PECOFF/ObjectFilePECOFF.cpp | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/lldb/source/Plugins/ObjectFile/PECOFF/ObjectFilePECOFF.cpp b/lldb/source/Plugins/ObjectFile/PECOFF/ObjectFilePECOFF.cpp index 7fb10a6..be0020c 100644 --- a/lldb/source/Plugins/ObjectFile/PECOFF/ObjectFilePECOFF.cpp +++ b/lldb/source/Plugins/ObjectFile/PECOFF/ObjectFilePECOFF.cpp @@ -791,11 +791,10 @@ void ObjectFilePECOFF::AppendFromCOFFSymbolTable( for (const auto &sym_ref : m_binary->symbols()) { const auto coff_sym_ref = m_binary->getCOFFSymbol(sym_ref); auto name_or_error = sym_ref.getName(); - if (auto err = name_or_error.takeError()) { - LLDB_LOG(log, - "ObjectFilePECOFF::AppendFromCOFFSymbolTable - failed to get " - "symbol table entry name: {0}", - llvm::fmt_consume(std::move(err))); + if (!name_or_error) { + LLDB_LOG_ERROR(log, name_or_error.takeError(), + "ObjectFilePECOFF::AppendFromCOFFSymbolTable - failed to " + "get symbol table entry name: {0}"); continue; } const llvm::StringRef sym_name = *name_or_error; |