Skip to content

Commit a4d4ab6

Browse files
authored
Merge pull request #36797 from ahoppen/pr/stdlib-loaded
[SourceKit] Verify the stdlib is loaded before creating an AST
2 parents 64602bb + 4107d02 commit a4d4ab6

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

tools/SourceKit/lib/SwiftLang/SwiftASTManager.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -848,6 +848,11 @@ ASTUnitRef ASTProducer::createASTUnit(
848848
Error = "compilation setup failed";
849849
return nullptr;
850850
}
851+
if (CompIns.loadStdlibIfNeeded()) {
852+
LOG_WARN_FUNC("Loading the stdlib failed");
853+
Error = "Loading the stdlib failed";
854+
return nullptr;
855+
}
851856
registerIDERequestFunctions(CompIns.getASTContext().evaluator);
852857
if (TracedOp.enabled()) {
853858
TracedOp.start(TraceInfo);

0 commit comments

Comments
 (0)