1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2025-01-31 12:41:49 +01:00

Attempt to fix Orc JIT test timeouts

I think there are some destruction ordering issues here. The
ShouldDelete map seems to be getting destroyed before the shared_ptr
deleter lambda accesses it. In any case, this avoids inserting elements
into the map during shutdown.

llvm-svn: 306736
This commit is contained in:
Reid Kleckner 2017-06-29 20:15:08 +00:00
parent bc16c3ba43
commit 15437b120c

View File

@ -193,11 +193,11 @@ public:
}
auto *MPtr = M.release();
ShouldDelete[MPtr] = true;
auto Deleter =
[this](Module *Mod) {
if (ShouldDelete[Mod])
delete Mod;
};
auto Deleter = [this](Module *Mod) {
auto I = ShouldDelete.find(Mod);
if (I != ShouldDelete.end() && I->second)
delete Mod;
};
LocalModules.push_back(std::shared_ptr<Module>(MPtr, std::move(Deleter)));
LazyEmitLayer.addModule(LocalModules.back(), &MemMgr, &Resolver);
}