diff --git a/llvm/lib/ExecutionEngine/Orc/LLJIT.cpp b/llvm/lib/ExecutionEngine/Orc/LLJIT.cpp index 4e3c09e970cbe..67bb7dd8ad08f 100644 --- a/llvm/lib/ExecutionEngine/Orc/LLJIT.cpp +++ b/llvm/lib/ExecutionEngine/Orc/LLJIT.cpp @@ -632,16 +632,19 @@ Error ORCPlatformSupport::initialize(orc::JITDylib &JD) { int32_t result; auto E = ES.callSPSWrapper(WrapperAddr->getAddress(), result, DSOHandles[&JD]); - if (result) + if (E) + return E; + else if (result) return make_error("dlupdate failed", inconvertibleErrorCode()); - return E; - } - return ES.callSPSWrapper(WrapperAddr->getAddress(), - DSOHandles[&JD], JD.getName(), - int32_t(ORC_RT_RTLD_LAZY)); + } else + return ES.callSPSWrapper(WrapperAddr->getAddress(), + DSOHandles[&JD], JD.getName(), + int32_t(ORC_RT_RTLD_LAZY)); } else return WrapperAddr.takeError(); + + return Error::success(); } Error ORCPlatformSupport::deinitialize(orc::JITDylib &JD) {