Skip to content

Commit 7213dab

Browse files
authored
Merge pull request #37483 from ahoppen/pr-5.4/rdar-78035923
[5.4][SourceKit] Verify the stdlib is loaded before creating an AST
2 parents 547ecb3 + c5e8a48 commit 7213dab

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)