Skip to content

Revert "Restrict RemoteASTTypeBuilder::findModule() to the list of lo… #17384

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 21, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 1 addition & 7 deletions lib/RemoteAST/RemoteAST.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -570,13 +570,7 @@ RemoteASTTypeBuilder::createNominalTypeDecl(const Demangle::NodePointer &node) {
ModuleDecl *RemoteASTTypeBuilder::findModule(const Demangle::NodePointer &node){
assert(node->getKind() == Demangle::Node::Kind::Module);
const auto &moduleName = node->getText();
// Intentionally using getLoadedModule() instead of getModuleByName() here.
// LLDB uses RemoteAST for its per-module SwiftASTContext. Importing external
// modules here could permanently damage this context, for example when a
// Clang import fails because of missing header search options. To avoid this
// situation, restrict RemoteAST's access to only the module's transitive
// closure of imports.
return Ctx.getLoadedModule(Ctx.getIdentifier(moduleName));
return Ctx.getModuleByName(moduleName);
}

Demangle::NodePointer
Expand Down