Skip to content

Commit

Permalink
[Orc][RuntimeDyld] Return after handling error (#95364)
Browse files Browse the repository at this point in the history
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).
  • Loading branch information
nikic authored Jul 4, 2024
1 parent 28be3f8 commit f99746f
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion llvm/lib/ExecutionEngine/RuntimeDyld/RuntimeDyld.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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));
Expand Down

0 comments on commit f99746f

Please sign in to comment.