Merge pull request #39032 from adrian-prantl/79462915-5.5

Disable resilience for modules imported by the MemoryBuffer loader.
This commit is contained in:
adrian-prantl
2021-09-20 16:45:19 -07:00
committed by GitHub
6 changed files with 48 additions and 19 deletions

View File

@@ -1234,6 +1234,11 @@ MemoryBufferSerializedModuleLoader::loadModule(SourceLoc importLoc,
if (!file)
return nullptr;
// The MemoryBuffer loader is used by LLDB during debugging. Modules imported
// from .swift_ast sections are never produced from textual interfaces. By
// disabling resilience the debugger can directly access private members.
if (BypassResilience)
M->setBypassResilience();
M->addFile(*file);
Ctx.addLoadedModule(M);
return M;