Skip to content

Commit 883a9ab

Browse files
committed
[cxx-interop] Fix crash when indexing with C++ interop enabled.
This is a stop-gap solution to prevent crashes.
1 parent 2928459 commit 883a9ab

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

lib/FrontendTool/FrontendTool.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1019,7 +1019,9 @@ static void performEndOfPipelineActions(CompilerInstance &Instance) {
10191019
// FIXME: This predicate matches the status quo, but there's no reason
10201020
// indexing cannot run for actions that do not require stdlib e.g. to better
10211021
// facilitate tests.
1022-
if (FrontendOptions::doesActionRequireSwiftStandardLibrary(action)) {
1022+
if (FrontendOptions::doesActionRequireSwiftStandardLibrary(action) &&
1023+
// TODO: indexing often crashes when interop is enabled (rdar://87719859).
1024+
!Invocation.getLangOptions().EnableCXXInterop) {
10231025
emitIndexData(Instance);
10241026
}
10251027

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
// RUN: %target-swift-frontend %s -c -index-system-modules -index-store-path %t -enable-cxx-interop
2+
//
3+
// REQUIRES: OS=macosx
4+
5+
import Foundation
6+
7+
func test(d: Date) {}

0 commit comments

Comments
 (0)