Skip to content

Commit 796994c

Browse files
authored
Merge pull request #6080 from akyrtzi/fix-crash-014
2 parents a32e11a + f548c2b commit 796994c

File tree

3 files changed

+3
-4
lines changed

3 files changed

+3
-4
lines changed

lib/Parse/ParseDecl.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4204,7 +4204,7 @@ ParserStatus Parser::parseDeclVar(ParseDeclOptions Flags,
42044204
if (init.hasCodeCompletion() && isCodeCompletionFirstPass()) {
42054205

42064206
// Register the end of the init as the end of the delayed parsing.
4207-
DelayedDeclEnd = init.get() ? init.get()->getEndLoc() : SourceLoc();
4207+
DelayedDeclEnd = init.getPtrOrNull() ? init.get()->getEndLoc() : SourceLoc();
42084208
return makeParserCodeCompletionStatus();
42094209
}
42104210

validation-test/IDE/crashers/014-swift-parser-parsedeclvar.swift

Lines changed: 0 additions & 3 deletions
This file was deleted.
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
// RUN: %target-swift-ide-test -code-completion -code-completion-token=A -source-filename=%s
2+
protocol A{let h=o#^A^#

0 commit comments

Comments
 (0)