File tree Expand file tree Collapse file tree 1 file changed +7
-1
lines changed Expand file tree Collapse file tree 1 file changed +7
-1
lines changed Original file line number Diff line number Diff line change @@ -570,7 +570,13 @@ RemoteASTTypeBuilder::createNominalTypeDecl(const Demangle::NodePointer &node) {
570
570
ModuleDecl *RemoteASTTypeBuilder::findModule (const Demangle::NodePointer &node){
571
571
assert (node->getKind () == Demangle::Node::Kind::Module);
572
572
const auto &moduleName = node->getText ();
573
- return Ctx.getModuleByName (moduleName);
573
+ // Intentionally using getLoadedModule() instead of getModuleByName() here.
574
+ // LLDB uses RemoteAST for its per-module SwiftASTContext. Importing external
575
+ // modules here could permanently damage this context, for example when a
576
+ // Clang import fails because of missing header search options. To avoid this
577
+ // situation, restrict RemoteAST's access to only the module's transitive
578
+ // closure of imports.
579
+ return Ctx.getLoadedModule (Ctx.getIdentifier (moduleName));
574
580
}
575
581
576
582
Demangle::NodePointer
You can’t perform that action at this time.
0 commit comments