Skip to content

Commit 220276c

Browse files
author
git apple-llvm automerger
committed
Merge commit 'a671ceec3343' from llvm.org/main into next
2 parents 0e27515 + a671cee commit 220276c

File tree

1 file changed

+10
-5
lines changed

1 file changed

+10
-5
lines changed

llvm/lib/ExecutionEngine/Orc/Core.cpp

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3379,12 +3379,17 @@ ExecutionSession::IL_failSymbols(JITDylib &JD,
33793379
for (auto &DependantEDU : MI.DependantEDUs) {
33803380

33813381
// Remove DependantEDU from all of its users DependantEDUs lists.
3382-
for (auto &[JD, Syms] : DependantEDU->Dependencies) {
3383-
for (auto Sym : Syms) {
3384-
assert(JD->Symbols.count(SymbolStringPtr(Sym)) && "Sym not in JD?");
3385-
assert(JD->MaterializingInfos.count(SymbolStringPtr(Sym)) &&
3382+
for (auto &[DepJD, DepSyms] : DependantEDU->Dependencies) {
3383+
for (auto DepSym : DepSyms) {
3384+
// Skip self-reference to avoid invalidating the MI.DependantEDUs
3385+
// map. We'll clear this later.
3386+
if (DepJD == &JD && DepSym == Name)
3387+
continue;
3388+
assert(DepJD->Symbols.count(SymbolStringPtr(DepSym)) &&
3389+
"DepSym not in DepJD?");
3390+
assert(DepJD->MaterializingInfos.count(SymbolStringPtr(DepSym)) &&
33863391
"DependantEDU not registered with symbol it depends on");
3387-
auto SymMI = JD->MaterializingInfos[SymbolStringPtr(Sym)];
3392+
auto &SymMI = DepJD->MaterializingInfos[SymbolStringPtr(DepSym)];
33883393
assert(SymMI.DependantEDUs.count(DependantEDU) &&
33893394
"DependantEDU missing from DependantEDUs list");
33903395
SymMI.DependantEDUs.erase(DependantEDU);

0 commit comments

Comments
 (0)