From 092dbfaad257885692fa64559e9eb43a5c466798 Mon Sep 17 00:00:00 2001 From: Nikita Popov Date: Thu, 13 Jun 2024 08:24:28 +0200 Subject: [PATCH] [Orc] Fix error handling (#95253) I believe we should return after the SDR for the error case, instead of invoking it a second time with Error::success(). --- .../llvm/ExecutionEngine/Orc/Shared/WrapperFunctionUtils.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/llvm/include/llvm/ExecutionEngine/Orc/Shared/WrapperFunctionUtils.h b/llvm/include/llvm/ExecutionEngine/Orc/Shared/WrapperFunctionUtils.h index bdb5ac143c34a9..2521bda0b42cf0 100644 --- a/llvm/include/llvm/ExecutionEngine/Orc/Shared/WrapperFunctionUtils.h +++ b/llvm/include/llvm/ExecutionEngine/Orc/Shared/WrapperFunctionUtils.h @@ -503,8 +503,10 @@ class WrapperFunction { SPSInputBuffer IB(R.data(), R.size()); if (auto Err = detail::ResultDeserializer::deserialize( - RetVal, R.data(), R.size())) + RetVal, R.data(), R.size())) { SDR(std::move(Err), std::move(RetVal)); + return; + } SDR(Error::success(), std::move(RetVal)); };