Skip to content

Commit 4d31fbb

Browse files
committed
[ORC] Propagate defineMaterializing failure when resource tracker is defunct.
Remove an overly aggressive cantFail: This call to defineMaterializing should never fail with a duplicate symbols error (since all new symbols shoul be weak), but may fail if the tracker has become defunct in the mean time. In that case we need to propagate the error.
1 parent d64632b commit 4d31fbb

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

llvm/lib/ExecutionEngine/Orc/ObjectLinkingLayer.cpp

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -455,9 +455,10 @@ class ObjectLinkingLayerJITLinkContext final : public JITLinkContext {
455455
ProcessSymbol(Sym);
456456

457457
// Attempt to claim all weak defs that we're not already responsible for.
458-
// This cannot fail -- any clashes will just result in rejection of our
459-
// claim, at which point we'll externalize that symbol.
460-
cantFail(MR->defineMaterializing(std::move(NewSymbolsToClaim)));
458+
// This may fail if the resource tracker has become defunct, but should
459+
// always succeed otherwise.
460+
if (auto Err = MR->defineMaterializing(std::move(NewSymbolsToClaim)))
461+
return Err;
461462

462463
// Walk the list of symbols that we just tried to claim. Symbols that we're
463464
// responsible for are marked live. Symbols that we're not responsible for

0 commit comments

Comments
 (0)