Skip to content

Commit 8f4444b

Browse files
lhamesmemfrob
authored andcommitted
[ORC] Fix an overly aggressive assert.
It is ok to add dependencies on symbols that are ready, they should just be skipped.
1 parent d2ac168 commit 8f4444b

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

llvm/lib/ExecutionEngine/Orc/Core.cpp

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1001,16 +1001,18 @@ void JITDylib::addDependencies(const SymbolStringPtr &Name,
10011001
// Check the sym entry for the dependency.
10021002
auto OtherSymI = OtherJITDylib.Symbols.find(OtherSymbol);
10031003

1004-
#ifndef NDEBUG
10051004
// Assert that this symbol exists and has not reached the ready state
10061005
// already.
10071006
assert(OtherSymI != OtherJITDylib.Symbols.end() &&
1008-
(OtherSymI->second.getState() < SymbolState::Ready &&
1009-
"Dependency on emitted/ready symbol"));
1010-
#endif
1007+
"Dependency on unknown symbol");
10111008

10121009
auto &OtherSymEntry = OtherSymI->second;
10131010

1011+
// If the other symbol is already in the Ready state then there's no
1012+
// dependency to add.
1013+
if (OtherSymEntry.getState() == SymbolState::Ready)
1014+
continue;
1015+
10141016
// If the dependency is in an error state then note this and continue,
10151017
// we will move this symbol to the error state below.
10161018
if (OtherSymEntry.getFlags().hasError()) {

0 commit comments

Comments
 (0)