summaryrefslogtreecommitdiffstats
path: root/llvm/tools
diff options
context:
space:
mode:
authorFrancis Visoiu Mistrih <francisvm@yahoo.com>2019-01-10 17:16:37 +0000
committerFrancis Visoiu Mistrih <francisvm@yahoo.com>2019-01-10 17:16:37 +0000
commit9f4f01182e4e4883559ef568baf1d7a315f6c93b (patch)
tree720a8cfbc3e8f28a86a0907f269a80c7c49a2b83 /llvm/tools
parent99b060e447d289fa93e4ee4e5ed4e75a5a4d3061 (diff)
downloadbcm5719-llvm-9f4f01182e4e4883559ef568baf1d7a315f6c93b.tar.gz
bcm5719-llvm-9f4f01182e4e4883559ef568baf1d7a315f6c93b.zip
[llvm-objdump][MachO] Correctly handle the llvm::Error when -dsym has errors
In an assert build, the Error gets destroyed and we get "Program aborted due to an unhandled Error:". In release, we get an empty message. llvm-svn: 350848
Diffstat (limited to 'llvm/tools')
-rw-r--r--llvm/tools/llvm-objdump/MachODump.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/llvm/tools/llvm-objdump/MachODump.cpp b/llvm/tools/llvm-objdump/MachODump.cpp
index 142ad8f6371..4198ff07ecb 100644
--- a/llvm/tools/llvm-objdump/MachODump.cpp
+++ b/llvm/tools/llvm-objdump/MachODump.cpp
@@ -6977,8 +6977,9 @@ static void DisassembleMachO(StringRef Filename, MachOObjectFile *MachOOF,
Expected<std::unique_ptr<MachOObjectFile>> DbgObjCheck =
ObjectFile::createMachOObjectFile(BufOrErr.get()->getMemBufferRef());
- if (DbgObjCheck.takeError())
- report_error(MachOOF->getFileName(), DbgObjCheck.takeError());
+ if (Error E = DbgObjCheck.takeError())
+ report_error(MachOOF->getFileName(), std::move(E));
+
DbgObj = DbgObjCheck.get().release();
// We need to keep the file alive, because we're replacing DbgObj with it.
DSYMBuf = std::move(BufOrErr.get());
OpenPOWER on IntegriCloud