Skip to content

Commit f99746f

Browse files
authored
[Orc][RuntimeDyld] Return after handling error (#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).
1 parent 28be3f8 commit f99746f

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

llvm/lib/ExecutionEngine/RuntimeDyld/RuntimeDyld.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1466,8 +1466,10 @@ void jitLinkForORC(
14661466
return;
14671467
}
14681468

1469-
if (auto Err = OnLoaded(*O.getBinary(), *Info, RTDyld.getSymbolTable()))
1469+
if (auto Err = OnLoaded(*O.getBinary(), *Info, RTDyld.getSymbolTable())) {
14701470
OnEmitted(std::move(O), std::move(Info), std::move(Err));
1471+
return;
1472+
}
14711473

14721474
RuntimeDyldImpl::finalizeAsync(std::move(RTDyld.Dyld), std::move(OnEmitted),
14731475
std::move(O), std::move(Info));

0 commit comments

Comments
 (0)