[llvm] [OFFLOAD][L0] More error handling (PR #188496)
Alex Duran via llvm-commits
llvm-commits at lists.llvm.org
Wed Mar 25 08:05:46 PDT 2026
================
@@ -700,14 +701,26 @@ Expected<OmpInteropTy> L0DeviceTy::createInterop(int32_t InteropContext,
Ret->rtl_property = new L0Interop::Property();
if (InteropContext == kmp_interop_type_targetsync) {
Ret->async_info = new __tgt_async_info();
+
+ // Ensure cleanup on error
+ llvm::scope_exit CleanupOnError([&]() {
+ if (Ret->async_info) {
----------------
adurang wrote:
lol, yes. I forgot to move the delete into here too. Good catch, thanks!
https://github.com/llvm/llvm-project/pull/188496
More information about the llvm-commits
mailing list