Skip to content

[SourceKit] Add test case for crash triggered in swift::TypeChecker::validateDecl(…) #611

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Dec 22, 2015
Merged

[SourceKit] Add test case for crash triggered in swift::TypeChecker::validateDecl(…) #611

merged 1 commit into from
Dec 22, 2015

Conversation

practicalswift
Copy link
Contributor

Stack trace:

found code completion token A at offset 114
swift-ide-test: /path/to/llvm/include/llvm/Support/Casting.h:237: typename cast_retty<X, Y *>::ret_type llvm::cast(Y *) [X = swift::NominalTypeDecl, Y = swift::DeclContext]: Assertion `isa<X>(Val) && "cast<Ty>() argument of incompatible type!"' failed.
8  swift-ide-test  0x0000000000933801 swift::TypeChecker::validateDecl(swift::ValueDecl*, bool) + 6753
11 swift-ide-test  0x0000000000b5ba16 swift::lookupVisibleDecls(swift::VisibleDeclConsumer&, swift::DeclContext const*, swift::LazyResolver*, bool, swift::SourceLoc) + 278
23 swift-ide-test  0x0000000000ae6574 swift::Decl::walk(swift::ASTWalker&) + 20
24 swift-ide-test  0x0000000000b6f99e swift::SourceFile::walk(swift::ASTWalker&) + 174
25 swift-ide-test  0x0000000000b6ed7f swift::ModuleDecl::walk(swift::ASTWalker&) + 79
26 swift-ide-test  0x0000000000b494f2 swift::DeclContext::walkContext(swift::ASTWalker&) + 146
27 swift-ide-test  0x00000000008644dd swift::performDelayedParsing(swift::DeclContext*, swift::PersistentParserState&, swift::CodeCompletionCallbacksFactory*) + 61
28 swift-ide-test  0x0000000000772e94 swift::CompilerInstance::performSema() + 3316
29 swift-ide-test  0x000000000071c557 main + 33239
Stack dump:
0.  Program arguments: swift-ide-test -code-completion -code-completion-token=A -source-filename=<INPUT-FILE>
1.  While walking into decl declaration 0x5d82ef0 at <INPUT-FILE>:2:1

…validateDecl(swift::ValueDecl*, bool)

Stack trace:

```
found code completion token A at offset 114
swift-ide-test: /path/to/llvm/include/llvm/Support/Casting.h:237: typename cast_retty<X, Y *>::ret_type llvm::cast(Y *) [X = swift::NominalTypeDecl, Y = swift::DeclContext]: Assertion `isa<X>(Val) && "cast<Ty>() argument of incompatible type!"' failed.
8  swift-ide-test  0x0000000000933801 swift::TypeChecker::validateDecl(swift::ValueDecl*, bool) + 6753
11 swift-ide-test  0x0000000000b5ba16 swift::lookupVisibleDecls(swift::VisibleDeclConsumer&, swift::DeclContext const*, swift::LazyResolver*, bool, swift::SourceLoc) + 278
23 swift-ide-test  0x0000000000ae6574 swift::Decl::walk(swift::ASTWalker&) + 20
24 swift-ide-test  0x0000000000b6f99e swift::SourceFile::walk(swift::ASTWalker&) + 174
25 swift-ide-test  0x0000000000b6ed7f swift::ModuleDecl::walk(swift::ASTWalker&) + 79
26 swift-ide-test  0x0000000000b494f2 swift::DeclContext::walkContext(swift::ASTWalker&) + 146
27 swift-ide-test  0x00000000008644dd swift::performDelayedParsing(swift::DeclContext*, swift::PersistentParserState&, swift::CodeCompletionCallbacksFactory*) + 61
28 swift-ide-test  0x0000000000772e94 swift::CompilerInstance::performSema() + 3316
29 swift-ide-test  0x000000000071c557 main + 33239
Stack dump:
0.	Program arguments: swift-ide-test -code-completion -code-completion-token=A -source-filename=<INPUT-FILE>
1.	While walking into decl declaration 0x5d82ef0 at <INPUT-FILE>:2:1
```
@practicalswift
Copy link
Contributor Author

@gribozavr Let me know if there is any changes needed to this crash case :-)

gribozavr added a commit that referenced this pull request Dec 22, 2015
…hecker-validatedecl

[SourceKit] Add test case for crash triggered in swift::TypeChecker::validateDecl(…)
@gribozavr gribozavr merged commit d0a60f5 into swiftlang:master Dec 22, 2015
freak4pc pushed a commit to freak4pc/swift that referenced this pull request Sep 28, 2022
Update the branch for main and delete old schemes
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants