Skip to content

Commit 9717af8

Browse files
don't load visible modules outside the error path
1 parent 61c92b2 commit 9717af8

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

tools/driver/swift_symbolgraph_extract_main.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -217,12 +217,13 @@ int swift_symbolgraph_extract_main(ArrayRef<const char *> Args, const char *Argv
217217
}
218218

219219
auto M = CI.getASTContext().getModuleByName(options::ModuleName);
220-
SmallVector<Identifier, 32> VisibleModuleNames;
221-
CI.getASTContext().getVisibleTopLevelModuleNames(VisibleModuleNames);
222220
if (!M) {
223221
llvm::errs()
224222
<< "Couldn't load module '" << options::ModuleName << '\''
225223
<< " in the current SDK and search paths.\n";
224+
225+
SmallVector<Identifier, 32> VisibleModuleNames;
226+
CI.getASTContext().getVisibleTopLevelModuleNames(VisibleModuleNames);
226227

227228
if (VisibleModuleNames.empty()) {
228229
llvm::errs() << "Could not find any modules.\n";

0 commit comments

Comments
 (0)