Merge pull request #22125 from aschwaighofer/workaround_dynamic_replacement_failure

DynamicReplacement: Don't fail when a library is closed and reloaded
This commit is contained in:
Arnold Schwaighofer
2019-01-26 07:57:06 -08:00
committed by GitHub
4 changed files with 89 additions and 0 deletions

View File

@@ -1696,11 +1696,15 @@ void DynamicReplacementDescriptor::enableReplacement() const {
replacedFunctionKey->root.get());
// Make sure this entry is not already enabled.
// This does not work until we make sure that when a dynamic library is
// unloaded all descriptors are removed.
#if 0
for (auto *curr = chainRoot; curr != nullptr; curr = curr->next) {
if (curr == chainEntry.get()) {
swift::swift_abortDynamicReplacementEnabling();
}
}
#endif
// Unlink the previous entry if we are not chaining.
if (!shouldChain() && chainRoot->next) {