mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
Frontend: Fix crash when -stats-output-dir used with -typecheck-module-from-interface
There's no ASTContext in this case, so we just skip initializing stats if the driver passes this flag down to us.
This commit is contained in:
@@ -563,7 +563,9 @@ bool CompilerInstance::setup(const CompilerInvocation &Invoke,
|
||||
return true;
|
||||
}
|
||||
|
||||
setupStatsReporter();
|
||||
if (hasASTContext()) {
|
||||
setupStatsReporter();
|
||||
}
|
||||
|
||||
if (setupDiagnosticVerifierIfNeeded()) {
|
||||
Error = "Setting up diagnostics verifier failed";
|
||||
|
||||
3
test/Misc/stats_dir_verify_module_interface.swift
Normal file
3
test/Misc/stats_dir_verify_module_interface.swift
Normal file
@@ -0,0 +1,3 @@
|
||||
// RUN: %empty-directory(%t)
|
||||
// RUN: %target-swift-emit-module-interface(%t/foo.swiftinterface) %s -module-name foo
|
||||
// RUN: %target-swift-frontend -typecheck-module-from-interface %t/foo.swiftinterface -stats-output-dir %t
|
||||
Reference in New Issue
Block a user