summaryrefslogtreecommitdiffstats
path: root/llvm/lib/ExecutionEngine/MCJIT
diff options
context:
space:
mode:
authorLang Hames <lhames@gmail.com>2018-08-15 20:11:21 +0000
committerLang Hames <lhames@gmail.com>2018-08-15 20:11:21 +0000
commit942cb7b3f8ea12a26f28be3d647b8c789a10a002 (patch)
treea502090e18e9b8f49d40907ebe6c1670e04b797b /llvm/lib/ExecutionEngine/MCJIT
parent6a691a0b7ccfa05b983e4e85e223ccfdbec2efbb (diff)
downloadbcm5719-llvm-942cb7b3f8ea12a26f28be3d647b8c789a10a002.tar.gz
bcm5719-llvm-942cb7b3f8ea12a26f28be3d647b8c789a10a002.zip
[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! llvm-svn: 339809
Diffstat (limited to 'llvm/lib/ExecutionEngine/MCJIT')
-rw-r--r--llvm/lib/ExecutionEngine/MCJIT/MCJIT.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/llvm/lib/ExecutionEngine/MCJIT/MCJIT.cpp b/llvm/lib/ExecutionEngine/MCJIT/MCJIT.cpp
index 2c663c2e1ed..25c0cb5d6ef 100644
--- a/llvm/lib/ExecutionEngine/MCJIT/MCJIT.cpp
+++ b/llvm/lib/ExecutionEngine/MCJIT/MCJIT.cpp
@@ -326,8 +326,9 @@ uint64_t MCJIT::getSymbolAddress(const std::string &Name,
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,
OpenPOWER on IntegriCloud