Skip to content

Commit e8a7081

Browse files
authored
Merge pull request #40527 from ahoppen/pr-5.6/fix-snapshot-nullptr-issue-test
[5.6][SourceKit] Adjust no-crash-reopen-without-compiler-args.swift test case to pass on Windows
2 parents e90da06 + 9404c95 commit e8a7081

File tree

2 files changed

+23
-51
lines changed

2 files changed

+23
-51
lines changed
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
// RUN: %empty-directory(%t)
2+
// RUN: %{python} %utils/split_file.py -o %t %s
3+
4+
// This used to crash with a nullptr dereference because we didn't store a
5+
// snapshot in the FileContents of primary.swift when it is opened for the first
6+
// time but we are trying to access the snapshot when trying determining if we
7+
// can reuse the AST for the cursor info request
8+
9+
// RUN: %sourcekitd-test \
10+
// RUN: -req=open %t/primary.swift -- %t/primary.swift %t/secondary.swift \
11+
// RUN: == -req=close %t/primary.swift \
12+
// RUN: == -req=open %t/primary.swift -- %t/primary.swift \
13+
// RUN: == -req=cursor -pos 2:8 %t/primary.swift -- %t/primary.swift %t/secondary.swift \
14+
// RUN: | %FileCheck %s
15+
16+
// BEGIN primary.swift
17+
18+
struct Foo {}
19+
// CHECK: source.lang.swift.decl.struct
20+
// CHECK-NEXT: Foo
21+
// CHECK-NEXT: s:4main3FooV
22+
23+
// BEGIN secondary.swift

test/SourceKit/Misc/no-crash-reopen-without-compiler-args.swift

Lines changed: 0 additions & 51 deletions
This file was deleted.

0 commit comments

Comments
 (0)