Skip to content

Commit cf11ca4

Browse files
committed
[SourceKit] Sanitize -embed-bitcode flag to avoid crashing. rdar://22874139
1 parent 5fddd4a commit cf11ca4

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

test/SourceKit/SourceDocInfo/cursor_overrides.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ func goo(x: SubCls) {
1616
x.meth()
1717
}
1818

19-
// RUN: %sourcekitd-test -req=cursor -pos=16:7 %s -- -triple x86_64-apple-macosx10.9 -I %S/Inputs/cursor-overrides %mcp_opt %s | FileCheck -check-prefix=CHECK1 %s
19+
// RUN: %sourcekitd-test -req=cursor -pos=16:7 %s -- -embed-bitcode -triple x86_64-apple-macosx10.9 -I %S/Inputs/cursor-overrides %mcp_opt %s | FileCheck -check-prefix=CHECK1 %s
2020
// CHECK1: source.lang.swift.ref.function.method.instance (12:8-12:14)
2121
// CHECK1: s:FC16cursor_overrides6SubCls4methFT_T_
2222
// CHECK1: SubCls -> () -> ()

tools/SourceKit/lib/SwiftLang/SwiftASTManager.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -364,6 +364,8 @@ static void sanitizeCompilerArgs(ArrayRef<const char *> Args,
364364
continue;
365365
if (Arg == "-Xfrontend")
366366
continue;
367+
if (Arg == "-embed-bitcode")
368+
continue;
367369
NewArgs.push_back(CArg);
368370
}
369371
}

0 commit comments

Comments
 (0)