[llvm] r339809 - [MCJIT] Fix a case of Error::success() being passed to report_fatal_error.
Lang Hames via llvm-commits
llvm-commits at lists.llvm.org
Wed Aug 15 13:11:22 PDT 2018
Author: lhames
Date: Wed Aug 15 13:11:21 2018
New Revision: 339809
URL: http://llvm.org/viewvc/llvm-project?rev=339809&view=rev
Log:
[MCJIT] Fix a case of Error::success() being passed to report_fatal_error.
MCJIT::getSymbolAddress was handling a non-fatal error condition of JITSymbol
as fatal. JITSymbol::operator bool returns false if no address is available
but no error is set. This can occur e.g. if the symbol name was not found.
Patch by Jascha Wetzel. Thanks Jascha!
Modified:
llvm/trunk/lib/ExecutionEngine/MCJIT/MCJIT.cpp
Modified: llvm/trunk/lib/ExecutionEngine/MCJIT/MCJIT.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/ExecutionEngine/MCJIT/MCJIT.cpp?rev=339809&r1=339808&r2=339809&view=diff
==============================================================================
--- llvm/trunk/lib/ExecutionEngine/MCJIT/MCJIT.cpp (original)
+++ llvm/trunk/lib/ExecutionEngine/MCJIT/MCJIT.cpp Wed Aug 15 13:11:21 2018
@@ -326,8 +326,9 @@ uint64_t MCJIT::getSymbolAddress(const s
return *AddrOrErr;
else
report_fatal_error(AddrOrErr.takeError());
- } else
+ } else if (auto Err = Sym.takeError())
report_fatal_error(Sym.takeError());
+ return 0;
}
JITSymbol MCJIT::findSymbol(const std::string &Name,
More information about the llvm-commits
mailing list