Skip to content

Commit 0ab09cc

Browse files
[SourceKit] Add test case for crash triggered in swift::Parser::parseDeclVar(swift::OptionSet<swift::Parser::ParseDeclFlags, unsigned int>, swift::DeclAttributes&, llvm::SmallVectorImpl<swift::Decl*>&, swift::SourceLoc, swift::StaticSpellingKind, swift::SourceLoc)
Stack trace: ``` found code completion token A at offset 123 swift-ide-test: /path/to/swift/include/swift/Parse/ParserResult.h:73: T *swift::ParserResult<swift::Expr>::get() const [T = swift::Expr]: Assertion `getPtrOrNull() && "not checked for nullptr"' failed. 8 swift-ide-test 0x000000000087687b swift::Parser::parseDeclVar(swift::OptionSet<swift::Parser::ParseDeclFlags, unsigned int>, swift::DeclAttributes&, llvm::SmallVectorImpl<swift::Decl*>&, swift::SourceLoc, swift::StaticSpellingKind, swift::SourceLoc) + 4619 9 swift-ide-test 0x00000000008737c4 swift::Parser::parseDecl(llvm::SmallVectorImpl<swift::Decl*>&, swift::OptionSet<swift::Parser::ParseDeclFlags, unsigned int>) + 2836 11 swift-ide-test 0x00000000008680c8 swift::Parser::parseList(swift::tok, swift::SourceLoc, swift::SourceLoc&, swift::tok, bool, bool, swift::Diag<>, std::function<swift::ParserStatus ()>) + 728 12 swift-ide-test 0x000000000087a612 swift::Parser::parseDeclProtocol(swift::OptionSet<swift::Parser::ParseDeclFlags, unsigned int>, swift::DeclAttributes&) + 1602 13 swift-ide-test 0x0000000000873a77 swift::Parser::parseDecl(llvm::SmallVectorImpl<swift::Decl*>&, swift::OptionSet<swift::Parser::ParseDeclFlags, unsigned int>) + 3527 14 swift-ide-test 0x00000000008bebab swift::Parser::parseBraceItems(llvm::SmallVectorImpl<swift::ASTNode>&, swift::BraceItemListKind, swift::BraceItemListKind) + 2027 15 swift-ide-test 0x000000000086a30c swift::Parser::parseTopLevel() + 156 16 swift-ide-test 0x000000000086591b swift::parseIntoSourceFile(swift::SourceFile&, unsigned int, bool*, swift::SILParserState*, swift::PersistentParserState*, swift::DelayedParsingCallbacks*) + 107 17 swift-ide-test 0x0000000000774176 swift::CompilerInstance::performSema() + 2918 18 swift-ide-test 0x000000000071cc33 main + 35011 Stack dump: 0. Program arguments: swift-ide-test -code-completion -code-completion-token=A -source-filename=<INPUT-FILE> 1. With parser at source location: <INPUT-FILE>:2:20 ```
1 parent e9a2e1e commit 0ab09cc

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
// RUN: not --crash %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)