Skip to content

Commit 1af1af7

Browse files
authored
Merge pull request swiftlang#77232 from slavapestov/no-ast-context
Frontend: Fix crash when -stats-output-dir used with -typecheck-module-from-interface
2 parents 2b6b98d + 9cd5b03 commit 1af1af7

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

lib/Frontend/Frontend.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -563,7 +563,9 @@ bool CompilerInstance::setup(const CompilerInvocation &Invoke,
563563
return true;
564564
}
565565

566-
setupStatsReporter();
566+
if (hasASTContext()) {
567+
setupStatsReporter();
568+
}
567569

568570
if (setupDiagnosticVerifierIfNeeded()) {
569571
Error = "Setting up diagnostics verifier failed";
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
// RUN: %empty-directory(%t)
2+
// RUN: %target-swift-emit-module-interface(%t/foo.swiftinterface) %s -module-name foo
3+
// RUN: %target-swift-frontend -typecheck-module-from-interface %t/foo.swiftinterface -stats-output-dir %t

0 commit comments

Comments
 (0)