[llvm] [Orc][RuntimeDyld] Return after handling error (PR #95364)
Nikita Popov via llvm-commits
llvm-commits at lists.llvm.org
Thu Jun 13 00:23:00 PDT 2024
https://github.com/nikic created https://github.com/llvm/llvm-project/pull/95364
If OnLoaded failed, return after passing the error to OnEmitted instead of also calling finalizeAsync (which would use values that have already been moved and perform another call to OnEmitted).
>From 0f39d6ce6868fd81dfdcdbc961332bd440b00211 Mon Sep 17 00:00:00 2001
From: Nikita Popov <npopov at redhat.com>
Date: Thu, 13 Jun 2024 09:19:05 +0200
Subject: [PATCH] [Orc][RuntimeDyld] Return after handling error
If OnLoaded failed, return after passing the error to OnEmitted
instead of also calling finalizeAsync (which would use values that
have already been moved and perform another call to OnEmitted).
---
llvm/lib/ExecutionEngine/RuntimeDyld/RuntimeDyld.cpp | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/llvm/lib/ExecutionEngine/RuntimeDyld/RuntimeDyld.cpp b/llvm/lib/ExecutionEngine/RuntimeDyld/RuntimeDyld.cpp
index a9aaff42433f6..79a190f447879 100644
--- a/llvm/lib/ExecutionEngine/RuntimeDyld/RuntimeDyld.cpp
+++ b/llvm/lib/ExecutionEngine/RuntimeDyld/RuntimeDyld.cpp
@@ -1466,8 +1466,10 @@ void jitLinkForORC(
return;
}
- if (auto Err = OnLoaded(*O.getBinary(), *Info, RTDyld.getSymbolTable()))
+ if (auto Err = OnLoaded(*O.getBinary(), *Info, RTDyld.getSymbolTable())) {
OnEmitted(std::move(O), std::move(Info), std::move(Err));
+ return;
+ }
RuntimeDyldImpl::finalizeAsync(std::move(RTDyld.Dyld), std::move(OnEmitted),
std::move(O), std::move(Info));
More information about the llvm-commits
mailing list