From: Lang Hames Date: Wed, 15 Aug 2018 20:11:21 +0000 (+0000) Subject: [MCJIT] Fix a case of Error::success() being passed to report_fatal_error. X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=942cb7b3f8ea12a26f28be3d647b8c789a10a002;p=platform%2Fupstream%2Fllvm.git [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 --- diff --git a/llvm/lib/ExecutionEngine/MCJIT/MCJIT.cpp b/llvm/lib/ExecutionEngine/MCJIT/MCJIT.cpp index 2c663c2..25c0cb5 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,