mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
jgrynspan/windows-GUID-hashable-6.2
1575 Commits
| Author | SHA1 | Message | Date | |
|---|---|---|---|---|
|
|
8df507a903 |
Merge pull request #3140 from rjmccall/invalid-type-context-in-super-ref
Handle invalid contexts when computing the super type. |
||
|
|
ddf49af810 | Handle invalid contexts when computing the super type. | ||
|
|
93b9eb5637 |
[swiftc] Add 💥 case (😢 → 47, 😀 → 5089) triggered in swift::TypeBase::getMemberSubstitutions(…)
Add crash case with stack trace:
```
4 swift 0x0000000001112d47 swift::TypeBase::getMemberSubstitutions(swift::DeclContext const*) + 23
5 swift 0x0000000001113186 swift::TypeBase::getTypeOfMember(swift::ModuleDecl*, swift::Type, swift::DeclContext const*) + 54
7 swift 0x0000000000ea2db9 swift::TypeChecker::checkDeclCircularity(swift::NominalTypeDecl*) + 393
13 swift 0x0000000000ea1586 swift::TypeChecker::typeCheckDecl(swift::Decl*, bool) + 150
16 swift 0x0000000000f08704 swift::TypeChecker::typeCheckClosureBody(swift::ClosureExpr*) + 244
17 swift 0x0000000000f3444c swift::constraints::ConstraintSystem::applySolution(swift::constraints::Solution&, swift::Expr*, swift::Type, bool, bool, bool) + 876
18 swift 0x0000000000e8fba1 swift::TypeChecker::typeCheckExpression(swift::Expr*&, swift::DeclContext*, swift::TypeLoc, swift::ContextualTypePurpose, swift::OptionSet<swift::TypeCheckExprFlags, unsigned int>, swift::ExprTypeCheckListener*) + 769
21 swift 0x0000000000f077dd swift::TypeChecker::typeCheckConstructorBodyUntil(swift::ConstructorDecl*, swift::SourceLoc) + 845
22 swift 0x0000000000f071e2 swift::TypeChecker::typeCheckAbstractFunctionBodyUntil(swift::AbstractFunctionDecl*, swift::SourceLoc) + 34
23 swift 0x0000000000f07db3 swift::TypeChecker::typeCheckAbstractFunctionBody(swift::AbstractFunctionDecl*) + 179
25 swift 0x0000000000ec3831 swift::performTypeChecking(swift::SourceFile&, swift::TopLevelContext&, swift::OptionSet<swift::TypeCheckingFlags, unsigned int>, unsigned int, unsigned int) + 1281
26 swift 0x0000000000c59299 swift::CompilerInstance::performSema() + 3289
28 swift 0x00000000007d72b9 swift::performFrontend(llvm::ArrayRef<char const*>, char const*, void*, swift::FrontendObserver*) + 2857
29 swift 0x00000000007a32c8 main + 2872
Stack dump:
0. Program arguments: /path/to/swift/bin/swift -frontend -c -primary-file validation-test/compiler_crashers/28326-swift-typebase-getmembersubstitutions.swift -target x86_64-unknown-linux-gnu -disable-objc-interop -module-name main -o /tmp/28326-swift-typebase-getmembersubstitutions-44b09e.o
1. While type-checking 'init' at validation-test/compiler_crashers/28326-swift-typebase-getmembersubstitutions.swift:9:9
2. While type-checking expression at [validation-test/compiler_crashers/28326-swift-typebase-getmembersubstitutions.swift:9:16 - line:9:53] RangeText="{extension{{}protocol a{struct B{let a"
3. While type-checking declaration 0x6103c20 at validation-test/compiler_crashers/28326-swift-typebase-getmembersubstitutions.swift:9:17
<unknown>:0: error: unable to execute command: Segmentation fault
<unknown>:0: error: compile command failed due to signal (use -v to see invocation)
```
|
||
|
|
0d0affb542 |
[swiftc] Add 💥 case (😢 → 46, 😀 → 5089) triggered in swift::TypeBase::getCanonicalType(…)
Add crash case with stack trace:
```
4 swift 0x0000000001108734 swift::TypeBase::getCanonicalType() + 20
8 swift 0x000000000105534e swift::Expr::walk(swift::ASTWalker&) + 46
9 swift 0x0000000000f73028 swift::constraints::ConstraintSystem::generateConstraints(swift::Expr*) + 200
10 swift 0x0000000000e891c3 swift::TypeChecker::solveForExpression(swift::Expr*&, swift::DeclContext*, swift::Type, swift::FreeTypeVariableBinding, swift::ExprTypeCheckListener*, swift::constraints::ConstraintSystem&, llvm::SmallVectorImpl<swift::constraints::Solution>&, swift::OptionSet<swift::TypeCheckExprFlags, unsigned int>) + 371
11 swift 0x0000000000e8fb02 swift::TypeChecker::typeCheckExpression(swift::Expr*&, swift::DeclContext*, swift::TypeLoc, swift::ContextualTypePurpose, swift::OptionSet<swift::TypeCheckExprFlags, unsigned int>, swift::ExprTypeCheckListener*) + 610
12 swift 0x0000000000e90cb7 swift::TypeChecker::typeCheckBinding(swift::Pattern*&, swift::Expr*&, swift::DeclContext*) + 343
13 swift 0x0000000000e90ecb swift::TypeChecker::typeCheckPatternBinding(swift::PatternBindingDecl*, unsigned int) + 267
16 swift 0x0000000000ea1586 swift::TypeChecker::typeCheckDecl(swift::Decl*, bool) + 150
19 swift 0x0000000000f08704 swift::TypeChecker::typeCheckClosureBody(swift::ClosureExpr*) + 244
20 swift 0x0000000000f3444c swift::constraints::ConstraintSystem::applySolution(swift::constraints::Solution&, swift::Expr*, swift::Type, bool, bool, bool) + 876
21 swift 0x0000000000e8fba1 swift::TypeChecker::typeCheckExpression(swift::Expr*&, swift::DeclContext*, swift::TypeLoc, swift::ContextualTypePurpose, swift::OptionSet<swift::TypeCheckExprFlags, unsigned int>, swift::ExprTypeCheckListener*) + 769
24 swift 0x0000000000f0738a swift::TypeChecker::typeCheckFunctionBodyUntil(swift::FuncDecl*, swift::SourceLoc) + 346
25 swift 0x0000000000f071ee swift::TypeChecker::typeCheckAbstractFunctionBodyUntil(swift::AbstractFunctionDecl*, swift::SourceLoc) + 46
26 swift 0x0000000000f07db3 swift::TypeChecker::typeCheckAbstractFunctionBody(swift::AbstractFunctionDecl*) + 179
28 swift 0x0000000000ec3831 swift::performTypeChecking(swift::SourceFile&, swift::TopLevelContext&, swift::OptionSet<swift::TypeCheckingFlags, unsigned int>, unsigned int, unsigned int) + 1281
29 swift 0x0000000000c59299 swift::CompilerInstance::performSema() + 3289
31 swift 0x00000000007d72b9 swift::performFrontend(llvm::ArrayRef<char const*>, char const*, void*, swift::FrontendObserver*) + 2857
32 swift 0x00000000007a32c8 main + 2872
Stack dump:
0. Program arguments: /path/to/swift/bin/swift -frontend -c -primary-file validation-test/compiler_crashers/28325-swift-typebase-getcanonicaltype.swift -target x86_64-unknown-linux-gnu -disable-objc-interop -module-name main -o /tmp/28325-swift-typebase-getcanonicaltype-2ce21e.o
1. While type-checking getter for h at validation-test/compiler_crashers/28325-swift-typebase-getcanonicaltype.swift:9:17
2. While type-checking expression at [validation-test/compiler_crashers/28325-swift-typebase-getcanonicaltype.swift:9:21 - line:9:34] RangeText="{var _=super.i"
3. While type-checking declaration 0x6522900 at validation-test/compiler_crashers/28325-swift-typebase-getcanonicaltype.swift:9:22
4. While type-checking expression at [validation-test/compiler_crashers/28325-swift-typebase-getcanonicaltype.swift:9:28 - line:9:34] RangeText="super.i"
<unknown>:0: error: unable to execute command: Segmentation fault
<unknown>:0: error: compile command failed due to signal (use -v to see invocation)
```
|
||
|
|
f74897fdd9 |
[swiftc] Add 💥 case (😢 → 45, 😀 → 5089) triggered in swift::DiagnosticEngine::emitDiagnostic(…)
Add crash case with stack trace: ``` swift: /path/to/llvm/include/llvm/Support/Casting.h:95: static bool llvm::isa_impl_cl<swift::ParenType, const swift::TypeBase *>::doit(const From *) [To = swift::ParenType, From = const swift::TypeBase *]: Assertion `Val && "isa<> used on a null pointer"' failed. 10 swift 0x00000000010c6e1b swift::DiagnosticEngine::emitDiagnostic(swift::Diagnostic const&) + 2923 11 swift 0x00000000010c608f swift::DiagnosticEngine::flushActiveDiagnostic() + 319 12 swift 0x0000000000e9c6e7 swift::TypeChecker::validateDecl(swift::ValueDecl*, bool) + 2391 19 swift 0x0000000000ea1586 swift::TypeChecker::typeCheckDecl(swift::Decl*, bool) + 150 20 swift 0x0000000000ec3732 swift::performTypeChecking(swift::SourceFile&, swift::TopLevelContext&, swift::OptionSet<swift::TypeCheckingFlags, unsigned int>, unsigned int, unsigned int) + 1026 21 swift 0x0000000000c59299 swift::CompilerInstance::performSema() + 3289 23 swift 0x00000000007d72b9 swift::performFrontend(llvm::ArrayRef<char const*>, char const*, void*, swift::FrontendObserver*) + 2857 24 swift 0x00000000007a32c8 main + 2872 Stack dump: 0. Program arguments: /path/to/swift/bin/swift -frontend -c -primary-file validation-test/compiler_crashers/28324-swift-diagnosticengine-emitdiagnostic.swift -target x86_64-unknown-linux-gnu -disable-objc-interop -module-name main -o /tmp/28324-swift-diagnosticengine-emitdiagnostic-23bd53.o 1. While type-checking 'a' at validation-test/compiler_crashers/28324-swift-diagnosticengine-emitdiagnostic.swift:10:1 <unknown>:0: error: unable to execute command: Aborted <unknown>:0: error: compile command failed due to signal (use -v to see invocation) ``` |
||
|
|
6407a26bd6 |
[swiftc] Add 💥 case (😢 → 44, 😀 → 5089) triggered in swift::TypeBase::getString(…) const
Add crash case with stack trace:
```
swift: /path/to/swift/lib/AST/ASTPrinter.cpp:4061: void (anonymous namespace)::TypePrinter::visitArchetypeType(swift::ArchetypeType *): Assertion `GTD && GTD->isProtocolSelf()' failed.
12 swift 0x0000000001025430 swift::TypeBase::getString(swift::PrintOptions const&) const + 160
14 swift 0x00000000010c6e1b swift::DiagnosticEngine::emitDiagnostic(swift::Diagnostic const&) + 2923
15 swift 0x00000000010c608f swift::DiagnosticEngine::flushActiveDiagnostic() + 319
19 swift 0x0000000000ea1586 swift::TypeChecker::typeCheckDecl(swift::Decl*, bool) + 150
22 swift 0x0000000000f08704 swift::TypeChecker::typeCheckClosureBody(swift::ClosureExpr*) + 244
23 swift 0x0000000000f3444c swift::constraints::ConstraintSystem::applySolution(swift::constraints::Solution&, swift::Expr*, swift::Type, bool, bool, bool) + 876
24 swift 0x0000000000e8fba1 swift::TypeChecker::typeCheckExpression(swift::Expr*&, swift::DeclContext*, swift::TypeLoc, swift::ContextualTypePurpose, swift::OptionSet<swift::TypeCheckExprFlags, unsigned int>, swift::ExprTypeCheckListener*) + 769
27 swift 0x0000000000f0738a swift::TypeChecker::typeCheckFunctionBodyUntil(swift::FuncDecl*, swift::SourceLoc) + 346
28 swift 0x0000000000f071ee swift::TypeChecker::typeCheckAbstractFunctionBodyUntil(swift::AbstractFunctionDecl*, swift::SourceLoc) + 46
29 swift 0x0000000000f07db3 swift::TypeChecker::typeCheckAbstractFunctionBody(swift::AbstractFunctionDecl*) + 179
31 swift 0x0000000000ec3831 swift::performTypeChecking(swift::SourceFile&, swift::TopLevelContext&, swift::OptionSet<swift::TypeCheckingFlags, unsigned int>, unsigned int, unsigned int) + 1281
32 swift 0x0000000000c59299 swift::CompilerInstance::performSema() + 3289
34 swift 0x00000000007d72b9 swift::performFrontend(llvm::ArrayRef<char const*>, char const*, void*, swift::FrontendObserver*) + 2857
35 swift 0x00000000007a32c8 main + 2872
Stack dump:
0. Program arguments: /path/to/swift/bin/swift -frontend -c -primary-file validation-test/compiler_crashers/28323-swift-typebase-getstring.swift -target x86_64-unknown-linux-gnu -disable-objc-interop -module-name main -o /tmp/28323-swift-typebase-getstring-f72c53.o
1. While type-checking 'a' at validation-test/compiler_crashers/28323-swift-typebase-getstring.swift:10:37
2. While type-checking expression at [validation-test/compiler_crashers/28323-swift-typebase-getstring.swift:10:44 - line:10:52] RangeText="{enum B:e"
3. While type-checking 'B' at validation-test/compiler_crashers/28323-swift-typebase-getstring.swift:10:45
<unknown>:0: error: unable to execute command: Aborted
<unknown>:0: error: compile command failed due to signal (use -v to see invocation)
```
|
||
|
|
23d752b2ca |
[swiftc] Add 💥 case (😢 → 43, 😀 → 5089) triggered in swift::TypeChecker::resolveTypeInContext(…)
Add crash case with stack trace: ``` swift: /path/to/swift/lib/Sema/TypeCheckType.cpp:404: swift::Type swift::TypeChecker::resolveTypeInContext(swift::TypeDecl *, swift::DeclContext *, TypeResolutionOptions, bool, swift::GenericTypeResolver *, UnsatisfiedDependency *): Assertion `incomplete && "Should have found type by now"' failed. 8 swift 0x0000000000f0d7f3 swift::TypeChecker::resolveTypeInContext(swift::TypeDecl*, swift::DeclContext*, swift::OptionSet<swift::TypeResolutionFlags, unsigned int>, bool, swift::GenericTypeResolver*, llvm::function_ref<bool (swift::TypeCheckRequest)>*) + 2851 12 swift 0x0000000000f0e65e swift::TypeChecker::resolveIdentifierType(swift::DeclContext*, swift::IdentTypeRepr*, swift::OptionSet<swift::TypeResolutionFlags, unsigned int>, bool, swift::GenericTypeResolver*, llvm::function_ref<bool (swift::TypeCheckRequest)>*) + 158 14 swift 0x0000000000f0f5a4 swift::TypeChecker::resolveType(swift::TypeRepr*, swift::DeclContext*, swift::OptionSet<swift::TypeResolutionFlags, unsigned int>, swift::GenericTypeResolver*, llvm::function_ref<bool (swift::TypeCheckRequest)>*) + 164 15 swift 0x0000000000f0e550 swift::TypeChecker::validateType(swift::TypeLoc&, swift::DeclContext*, swift::OptionSet<swift::TypeResolutionFlags, unsigned int>, swift::GenericTypeResolver*, llvm::function_ref<bool (swift::TypeCheckRequest)>*) + 192 16 swift 0x0000000000fd3e1f swift::IterativeTypeChecker::processResolveInheritedClauseEntry(std::pair<llvm::PointerUnion<swift::TypeDecl*, swift::ExtensionDecl*>, unsigned int>, llvm::function_ref<bool (swift::TypeCheckRequest)>) + 159 17 swift 0x0000000000fac54d swift::IterativeTypeChecker::satisfy(swift::TypeCheckRequest) + 493 18 swift 0x0000000000e99489 swift::TypeChecker::resolveInheritanceClause(llvm::PointerUnion<swift::TypeDecl*, swift::ExtensionDecl*>) + 137 19 swift 0x0000000000e9c22f swift::TypeChecker::validateDecl(swift::ValueDecl*, bool) + 1183 23 swift 0x0000000000f0e65e swift::TypeChecker::resolveIdentifierType(swift::DeclContext*, swift::IdentTypeRepr*, swift::OptionSet<swift::TypeResolutionFlags, unsigned int>, bool, swift::GenericTypeResolver*, llvm::function_ref<bool (swift::TypeCheckRequest)>*) + 158 25 swift 0x0000000000f0f5a4 swift::TypeChecker::resolveType(swift::TypeRepr*, swift::DeclContext*, swift::OptionSet<swift::TypeResolutionFlags, unsigned int>, swift::GenericTypeResolver*, llvm::function_ref<bool (swift::TypeCheckRequest)>*) + 164 26 swift 0x0000000000f0e550 swift::TypeChecker::validateType(swift::TypeLoc&, swift::DeclContext*, swift::OptionSet<swift::TypeResolutionFlags, unsigned int>, swift::GenericTypeResolver*, llvm::function_ref<bool (swift::TypeCheckRequest)>*) + 192 27 swift 0x0000000000ee1237 swift::TypeChecker::typeCheckPattern(swift::Pattern*, swift::DeclContext*, swift::OptionSet<swift::TypeResolutionFlags, unsigned int>, swift::GenericTypeResolver*) + 967 30 swift 0x0000000000ea1586 swift::TypeChecker::typeCheckDecl(swift::Decl*, bool) + 150 33 swift 0x0000000000f0738a swift::TypeChecker::typeCheckFunctionBodyUntil(swift::FuncDecl*, swift::SourceLoc) + 346 34 swift 0x0000000000f071ee swift::TypeChecker::typeCheckAbstractFunctionBodyUntil(swift::AbstractFunctionDecl*, swift::SourceLoc) + 46 35 swift 0x0000000000f07db3 swift::TypeChecker::typeCheckAbstractFunctionBody(swift::AbstractFunctionDecl*) + 179 37 swift 0x0000000000ec3831 swift::performTypeChecking(swift::SourceFile&, swift::TopLevelContext&, swift::OptionSet<swift::TypeCheckingFlags, unsigned int>, unsigned int, unsigned int) + 1281 38 swift 0x0000000000c59299 swift::CompilerInstance::performSema() + 3289 40 swift 0x00000000007d72b9 swift::performFrontend(llvm::ArrayRef<char const*>, char const*, void*, swift::FrontendObserver*) + 2857 41 swift 0x00000000007a32c8 main + 2872 Stack dump: 0. Program arguments: /path/to/swift/bin/swift -frontend -c -primary-file validation-test/compiler_crashers/28322-swift-typechecker-resolvetypeincontext.swift -target x86_64-unknown-linux-gnu -disable-objc-interop -module-name main -o /tmp/28322-swift-typechecker-resolvetypeincontext-f548db.o 1. While type-checking 'a' at validation-test/compiler_crashers/28322-swift-typechecker-resolvetypeincontext.swift:10:21 2. While type-checking declaration 0x6499750 at validation-test/compiler_crashers/28322-swift-typechecker-resolvetypeincontext.swift:10:28 3. While resolving type A at [validation-test/compiler_crashers/28322-swift-typechecker-resolvetypeincontext.swift:10:32 - line:10:32] RangeText="A" 4. While resolving type A at [validation-test/compiler_crashers/28322-swift-typechecker-resolvetypeincontext.swift:10:62 - line:10:62] RangeText="A" <unknown>:0: error: unable to execute command: Aborted <unknown>:0: error: compile command failed due to signal (use -v to see invocation) ``` |
||
|
|
5f74303fc1 |
[swiftc] Add 💥 case (😢 → 42, 😀 → 5090) triggered in swift::constraints::ConstraintSystem::resolveOverload(…)
Add crash case with stack trace: ``` <T <T <T swift: /path/to/swift/lib/Sema/ConstraintSystem.cpp:1509: void swift::constraints::ConstraintSystem::resolveOverload(swift::constraints::ConstraintLocator *, swift::Type, swift::constraints::OverloadChoice): Assertion `!refType->hasTypeParameter() && "Cannot have a dependent type here"' failed. 8 swift 0x0000000000f2e012 swift::constraints::ConstraintSystem::resolveOverload(swift::constraints::ConstraintLocator*, swift::Type, swift::constraints::OverloadChoice) + 4178 9 swift 0x0000000000f972a9 swift::constraints::ConstraintSystem::simplifyConstraint(swift::constraints::Constraint const&) + 905 10 swift 0x0000000000f29a97 swift::constraints::ConstraintSystem::addConstraint(swift::constraints::Constraint*, bool, bool) + 23 11 swift 0x0000000000f2cf57 swift::constraints::ConstraintSystem::addOverloadSet(swift::Type, llvm::ArrayRef<swift::constraints::OverloadChoice>, swift::constraints::ConstraintLocator*, swift::constraints::OverloadChoice*) + 327 12 swift 0x0000000000f95e53 swift::constraints::ConstraintSystem::simplifyMemberConstraint(swift::constraints::Constraint const&) + 563 13 swift 0x0000000000f96f64 swift::constraints::ConstraintSystem::simplifyConstraint(swift::constraints::Constraint const&) + 68 14 swift 0x0000000000f29a97 swift::constraints::ConstraintSystem::addConstraint(swift::constraints::Constraint*, bool, bool) + 23 20 swift 0x0000000001054a4e swift::Expr::walk(swift::ASTWalker&) + 46 21 swift 0x0000000000f72b68 swift::constraints::ConstraintSystem::generateConstraints(swift::Expr*) + 200 22 swift 0x0000000000e89003 swift::TypeChecker::solveForExpression(swift::Expr*&, swift::DeclContext*, swift::Type, swift::FreeTypeVariableBinding, swift::ExprTypeCheckListener*, swift::constraints::ConstraintSystem&, llvm::SmallVectorImpl<swift::constraints::Solution>&, swift::OptionSet<swift::TypeCheckExprFlags, unsigned int>) + 371 23 swift 0x0000000000e8f942 swift::TypeChecker::typeCheckExpression(swift::Expr*&, swift::DeclContext*, swift::TypeLoc, swift::ContextualTypePurpose, swift::OptionSet<swift::TypeCheckExprFlags, unsigned int>, swift::ExprTypeCheckListener*) + 610 26 swift 0x0000000000f0761d swift::TypeChecker::typeCheckConstructorBodyUntil(swift::ConstructorDecl*, swift::SourceLoc) + 845 27 swift 0x0000000000f07022 swift::TypeChecker::typeCheckAbstractFunctionBodyUntil(swift::AbstractFunctionDecl*, swift::SourceLoc) + 34 28 swift 0x0000000000f07bf3 swift::TypeChecker::typeCheckAbstractFunctionBody(swift::AbstractFunctionDecl*) + 179 30 swift 0x0000000000ec3671 swift::performTypeChecking(swift::SourceFile&, swift::TopLevelContext&, swift::OptionSet<swift::TypeCheckingFlags, unsigned int>, unsigned int, unsigned int) + 1281 31 swift 0x0000000000c590f9 swift::CompilerInstance::performSema() + 3289 33 swift 0x00000000007d72b9 swift::performFrontend(llvm::ArrayRef<char const*>, char const*, void*, swift::FrontendObserver*) + 2857 34 swift 0x00000000007a32c8 main + 2872 Stack dump: 0. Program arguments: /path/to/swift/bin/swift -frontend -c -primary-file validation-test/compiler_crashers/28321-swift-constraints-constraintsystem-resolveoverload.swift -target x86_64-unknown-linux-gnu -disable-objc-interop -module-name main -o /tmp/28321-swift-constraints-constraintsystem-resolveoverload-7439f0.o 1. While type-checking 'init' at validation-test/compiler_crashers/28321-swift-constraints-constraintsystem-resolveoverload.swift:10:11 2. While type-checking expression at [<invalid loc> - <invalid loc>] <unknown>:0: error: unable to execute command: Aborted <unknown>:0: error: compile command failed due to signal (use -v to see invocation) ``` |
||
|
|
67310e26c4 |
[swiftc] Add 💥 case (😢 → 42, 😀 → 5090) triggered in swift::ArchetypeBuilder::enumerateRequirements(…)
Add crash case with stack trace:
```
swift: /path/to/swift/lib/AST/GenericSignature.cpp:283: auto swift::GenericSignature::getCanonicalManglingSignature(swift::ModuleDecl &)::(anonymous class)::operator()(swift::RequirementKind, ArchetypeBuilder::PotentialArchetype *, llvm::PointerUnion<Type, ArchetypeBuilder::PotentialArchetype *>, swift::RequirementSource) const: Assertion `constraintType->isExistentialType()' failed.
10 swift 0x0000000000fdd429 swift::ArchetypeBuilder::enumerateRequirements(llvm::function_ref<void (swift::RequirementKind, swift::ArchetypeBuilder::PotentialArchetype*, llvm::PointerUnion<swift::Type, swift::ArchetypeBuilder::PotentialArchetype*>, swift::RequirementSource)>) + 185
11 swift 0x00000000010d2395 swift::GenericSignature::getCanonicalManglingSignature(swift::ModuleDecl&) const + 405
12 swift 0x0000000000f29dd5 swift::constraints::ConstraintSystem::openFunctionType(swift::AnyFunctionType*, swift::constraints::ConstraintLocatorBuilder, llvm::DenseMap<swift::CanType, swift::TypeVariableType*, llvm::DenseMapInfo<swift::CanType>, llvm::detail::DenseMapPair<swift::CanType, swift::TypeVariableType*> >&, swift::DeclContext*, swift::DeclContext*, bool) + 133
13 swift 0x0000000000f2ad37 swift::constraints::ConstraintSystem::getTypeOfReference(swift::ValueDecl*, bool, bool, swift::constraints::ConstraintLocatorBuilder, swift::DeclRefExpr const*) + 1127
18 swift 0x0000000000ee7ea9 swift::TypeChecker::checkConformance(swift::NormalProtocolConformance*) + 2313
19 swift 0x0000000000ee8347 swift::TypeChecker::checkConformancesInContext(swift::DeclContext*, swift::IterableDeclContext*) + 471
22 swift 0x0000000000ea13c6 swift::TypeChecker::typeCheckDecl(swift::Decl*, bool) + 150
25 swift 0x0000000000f08544 swift::TypeChecker::typeCheckClosureBody(swift::ClosureExpr*) + 244
26 swift 0x0000000000f3428c swift::constraints::ConstraintSystem::applySolution(swift::constraints::Solution&, swift::Expr*, swift::Type, bool, bool, bool) + 876
27 swift 0x0000000000e8f9e1 swift::TypeChecker::typeCheckExpression(swift::Expr*&, swift::DeclContext*, swift::TypeLoc, swift::ContextualTypePurpose, swift::OptionSet<swift::TypeCheckExprFlags, unsigned int>, swift::ExprTypeCheckListener*) + 769
28 swift 0x0000000000e90af7 swift::TypeChecker::typeCheckBinding(swift::Pattern*&, swift::Expr*&, swift::DeclContext*) + 343
29 swift 0x0000000000e90d0b swift::TypeChecker::typeCheckPatternBinding(swift::PatternBindingDecl*, unsigned int) + 267
38 swift 0x0000000000ea13c6 swift::TypeChecker::typeCheckDecl(swift::Decl*, bool) + 150
39 swift 0x0000000000ec3572 swift::performTypeChecking(swift::SourceFile&, swift::TopLevelContext&, swift::OptionSet<swift::TypeCheckingFlags, unsigned int>, unsigned int, unsigned int) + 1026
40 swift 0x0000000000c590f9 swift::CompilerInstance::performSema() + 3289
42 swift 0x00000000007d72b9 swift::performFrontend(llvm::ArrayRef<char const*>, char const*, void*, swift::FrontendObserver*) + 2857
43 swift 0x00000000007a32c8 main + 2872
Stack dump:
0. Program arguments: /path/to/swift/bin/swift -frontend -c -primary-file validation-test/compiler_crashers/28320-swift-archetypebuilder-enumeraterequirements.swift -target x86_64-unknown-linux-gnu -disable-objc-interop -module-name main -o /tmp/28320-swift-archetypebuilder-enumeraterequirements-3ae5c2.o
1. While type-checking declaration 0x50d5c40 at validation-test/compiler_crashers/28320-swift-archetypebuilder-enumeraterequirements.swift:10:1
2. While type-checking expression at [validation-test/compiler_crashers/28320-swift-archetypebuilder-enumeraterequirements.swift:10:37 - line:10:45] RangeText="{enum T{c"
3. While type-checking 'T' at validation-test/compiler_crashers/28320-swift-archetypebuilder-enumeraterequirements.swift:10:38
<unknown>:0: error: unable to execute command: Aborted
<unknown>:0: error: compile command failed due to signal (use -v to see invocation)
```
|
||
|
|
6f3f17ce7f |
[swiftc] Add 💥 case (😢 → 41, 😀 → 5090) triggered in swift::TypeChecker::checkConformance(…)
Add crash case with stack trace: ``` swift: /path/to/swift/lib/Sema/TypeCheckProtocol.cpp:1583: diag::RequirementKind getRequirementKind(swift::ValueDecl *): Assertion `isa<SubscriptDecl>(VD) && "Unhandled requirement kind"' failed. 10 swift 0x0000000000ee7bef swift::TypeChecker::checkConformance(swift::NormalProtocolConformance*) + 1615 12 swift 0x0000000000ec3671 swift::performTypeChecking(swift::SourceFile&, swift::TopLevelContext&, swift::OptionSet<swift::TypeCheckingFlags, unsigned int>, unsigned int, unsigned int) + 1281 13 swift 0x0000000000c590f9 swift::CompilerInstance::performSema() + 3289 15 swift 0x00000000007d72b9 swift::performFrontend(llvm::ArrayRef<char const*>, char const*, void*, swift::FrontendObserver*) + 2857 16 swift 0x00000000007a32c8 main + 2872 Stack dump: 0. Program arguments: /path/to/swift/bin/swift -frontend -c -primary-file validation-test/compiler_crashers/28319-swift-typechecker-checkconformance.swift -target x86_64-unknown-linux-gnu -disable-objc-interop -module-name main -o /tmp/28319-swift-typechecker-checkconformance-4d62c4.o <unknown>:0: error: unable to execute command: Aborted <unknown>:0: error: compile command failed due to signal (use -v to see invocation) ``` |
||
|
|
b46b433336 | Just-added compiler_crasher is already fixed :) | ||
|
|
5b4ee41772 |
Parser: Diagnose if free-standing 'where' clause is attached to a non-generic declaration
Previously we would produce an empty GenericParamList, crashing Sema. |
||
|
|
7814c47b71 |
AST: Slightly change meaning of NominalTypeDecl::getDeclaredType()
Consider this code:
struct A<T> {
struct B {}
struct C<U> {}
}
Previously:
- getDeclaredType() of 'A.B' would give 'A<T>.B'
- getDeclaredTypeInContext() of 'A.B' would give 'A<T>.B'
- getDeclaredType() of 'A.C' would give 'A<T>.C'
- getDeclaredTypeInContext() of 'A.C' would give 'A<T>.C<U>'
This was causing problems for nested generics. Now, with this change,
- getDeclaredType() of 'A.B' gives 'A.B' (*)
- getDeclaredTypeInContext() of 'A.B' gives 'A<T>.B'
- getDeclaredType() of 'A.C' gives 'A.C' (*)
- getDeclaredTypeInContext() of 'A.C' gives 'A<T>.C<U>'
(Differences marked with (*)).
Also, this change makes these accessors fully lazy. Previously,
only getDeclaredTypeInContext() and getDeclaredIterfaceType()
were lazy, whereas getDeclaredType() was built from validateDecl().
Fix a few spots where the return value wasn't being checked
properly.
These functions return ErrorType if a circularity was detected via
the generic parameter list, or if the extension did not resolve.
They return Type() if the extension cannot be resolved *yet*.
This is pretty subtle, and I'll need to do another pass over
callers of these functions at some point. Many of them should be
moved over to use getSelfInContext(), getSelfOfContext() and
getSelfInterfaceType() instead.
Finally, this patch consolidates logic for diagnosting invalid
nesting of types.
The parser had some code for protocols in bad places and bad things
inside protocols, and Sema had several different bail-outs for
bad things in protocols, nested generic types, and stuff nested
inside protocol extensions.
Combine all of these into a single set of checks in Sema. Note
that we no longer give up early if we find invalid nesting.
Leaving decls unvalidated and un-type-checked only leads to
further problems. Now that all the preliminary crap has been
fixed, we can go ahead and start validating these funny nested
decls, actually fixing some crashers in the process.
|
||
|
|
0fc095c775 |
Sema: Re-arrange deck chairs again
Another pre-emptive compiler_crasher regression fix. I have an idea for consolidating some of these hacky circularity checks in a nice way, but not now. |
||
|
|
7b6736df29 |
Sema: When validating a nested type, only validate the parent, do not type check it
There's no need to walk the siblings of the nested type. This fixes a class of infinite recursion issues when inheriting from nested types. |
||
|
|
528a4a547c |
Sema: Clean up some code duplication when validating generic type signatures
Every call to validateGenericTypeSignature() had the same
boilerplate following; move the common logic into that
function.
As one might expect, each callsite had slight variants on
the same underlying logic -- this makes them consistent.
Also, this slightly widens the scope during which
GenericTypeDecl::isValidatingGenericSignature() returns
true.
Interesting, that change introduces a diagnostic in an
existing testcase where previously there was none:
protocol P {
associatedtype T
}
struct S<A: P where A.T == S<A>> {}
While it looks like this generic signature was built
correctly, in fact I think we weren't computing
conformances for the substitution of 'A' in 'S<A>'.
After trying small variations on the above testcase,
I quickly ran into SILGen crashes, which the diagnostic
now prevents. A few interesting cases still crash.
See test/decl/protocol/req/recursion.swift for the
gory details.
|
||
|
|
2751eae5b7 |
[swiftc] Add 💥 case (😢 → 57, 😀 → 5073) triggered in swift::constraints::ConstraintGraphNode::getMemberType(…)
Add crash case with stack trace: ``` swift: /path/to/swift/lib/Sema/ConstraintSystem.h:1350: void swift::constraints::ConstraintSystem::addConstraint(swift::constraints::ConstraintKind, swift::Type, swift::Type, swift::constraints::ConstraintLocator *, bool): Assertion `second && "Missing second type"' failed. 10 swift 0x0000000000fca006 swift::constraints::ConstraintGraphNode::getMemberType(swift::Identifier, std::function<swift::TypeVariableType* ()>) + 182 11 swift 0x0000000000fcabca swift::constraints::ConstraintGraph::getMemberType(swift::TypeVariableType*, swift::Identifier, std::function<swift::TypeVariableType* ()>) + 154 13 swift 0x0000000001110674 swift::Type::transform(llvm::function_ref<swift::Type (swift::Type)>) const + 36 14 swift 0x0000000000f2b71b swift::constraints::ConstraintSystem::openGeneric(swift::DeclContext*, swift::DeclContext*, llvm::ArrayRef<swift::GenericTypeParamType*>, llvm::ArrayRef<swift::Requirement>, bool, swift::constraints::ConstraintLocatorBuilder, llvm::DenseMap<swift::CanType, swift::TypeVariableType*, llvm::DenseMapInfo<swift::CanType>, llvm::detail::DenseMapPair<swift::CanType, swift::TypeVariableType*> >&) + 1611 16 swift 0x0000000001110674 swift::Type::transform(llvm::function_ref<swift::Type (swift::Type)>) const + 36 17 swift 0x0000000000f29bce swift::constraints::ConstraintSystem::openType(swift::Type, swift::constraints::ConstraintLocatorBuilder, llvm::DenseMap<swift::CanType, swift::TypeVariableType*, llvm::DenseMapInfo<swift::CanType>, llvm::detail::DenseMapPair<swift::CanType, swift::TypeVariableType*> >&) + 78 20 swift 0x0000000001054835 swift::Expr::walk(swift::ASTWalker&) + 69 21 swift 0x0000000000f729d8 swift::constraints::ConstraintSystem::generateConstraints(swift::Expr*) + 200 22 swift 0x0000000000e88d93 swift::TypeChecker::solveForExpression(swift::Expr*&, swift::DeclContext*, swift::Type, swift::FreeTypeVariableBinding, swift::ExprTypeCheckListener*, swift::constraints::ConstraintSystem&, llvm::SmallVectorImpl<swift::constraints::Solution>&, swift::OptionSet<swift::TypeCheckExprFlags, unsigned int>) + 371 23 swift 0x0000000000e8f6d2 swift::TypeChecker::typeCheckExpression(swift::Expr*&, swift::DeclContext*, swift::TypeLoc, swift::ContextualTypePurpose, swift::OptionSet<swift::TypeCheckExprFlags, unsigned int>, swift::ExprTypeCheckListener*) + 610 26 swift 0x0000000000f08536 swift::TypeChecker::typeCheckTopLevelCodeDecl(swift::TopLevelCodeDecl*) + 134 27 swift 0x0000000000ec477d swift::performTypeChecking(swift::SourceFile&, swift::TopLevelContext&, swift::OptionSet<swift::TypeCheckingFlags, unsigned int>, unsigned int, unsigned int) + 1133 28 swift 0x0000000000c58f89 swift::CompilerInstance::performSema() + 3289 30 swift 0x00000000007d7139 swift::performFrontend(llvm::ArrayRef<char const*>, char const*, void*, swift::FrontendObserver*) + 2857 31 swift 0x00000000007a3148 main + 2872 Stack dump: 0. Program arguments: /path/to/swift/bin/swift -frontend -c -primary-file validation-test/compiler_crashers/28318-swift-constraints-constraintgraphnode-getmembertype.swift -target x86_64-unknown-linux-gnu -disable-objc-interop -module-name main -o /tmp/28318-swift-constraints-constraintgraphnode-getmembertype-792685.o 1. While type-checking expression at [validation-test/compiler_crashers/28318-swift-constraints-constraintgraphnode-getmembertype.swift:12:5 - line:12:5] RangeText="c" <unknown>:0: error: unable to execute command: Aborted <unknown>:0: error: compile command failed due to signal (use -v to see invocation) ``` |
||
|
|
a78f23c85e |
[swiftc] Remove duplicate crash cases.
Definition of uniqueness:
*
|
||
|
|
4446bc0692 |
Sema: Use FoldingSetNode for ProtocolType
There was a weirdness with ProtocolType::get() that was causing me grief while trying to refactor getDeclaredType() and related code in another patch. Instead of caching the result like we do elsewhere, this would directly store the new type into the ProtocolDecl. This is smelly, so let's not do that. |
||
|
|
769a5a2048 |
Sema: Small cleanups
Mostly NFC, but note that DeclContext::getDeclaredInterfaceType() returns Type() for invalid extensions, whereas the older way of going through getAsNominalTypeOrNominalTypeExtensionContext() would crash because we'd call getDeclaredInterfaceType() on a null decl. |
||
|
|
bb6521b9b6 |
Sema: Improve a circularity-breaking hack
The old check was problematic because it would sometimes return ErrorType from accessing the generic parameters of a type that was in the process of having its generic signature validated. Instead fix the root cause of the circularity, which was recursion through resolveType() when resolving a type's inheritance clause. To fix it, let's just not walk adopted protocols when looking up the superclass of a class. Inheriting from an associated type does not seem very useful, and will probably be hard to get right in the general case. I wasn't able to reduce a useful test case, but this patch prevents compiler_crashers regressions with some other changes I'm working on. |
||
|
|
e5f0cf93a9 | Sema: Pass down NL_OnlyTypes in a couple more places | ||
|
|
fb6e46edda |
[swiftc] Add 💥 case (😢 → 93, 😀 → 5067) triggered in swift::TypeCheck::checkGenericParamList(…)
Stack trace:
```
4 swift 0x0000000000ed9e8d swift::TypeChecker::checkGenericParamList(swift::ArchetypeBuilder*, swift::GenericParamList*, swift::GenericSignature*, bool, swift::GenericTypeResolver*) + 93
5 swift 0x0000000000edb6a7 swift::TypeChecker::validateGenericSignature(swift::GenericParamList*, swift::DeclContext*, swift::GenericSignature*, std::function<bool (swift::ArchetypeBuilder&)>, bool&) + 135
6 swift 0x0000000000edba46 swift::TypeChecker::validateGenericTypeSignature(swift::GenericTypeDecl*) + 102
7 swift 0x0000000000e9c90f swift::TypeChecker::validateDecl(swift::ValueDecl*, bool) + 367
11 swift 0x0000000000f0e6de swift::TypeChecker::resolveIdentifierType(swift::DeclContext*, swift::IdentTypeRepr*, swift::OptionSet<swift::TypeResolutionFlags, unsigned int>, bool, swift::GenericTypeResolver*, llvm::function_ref<bool (swift::TypeCheckRequest)>*) + 158
13 swift 0x0000000000f0f7b4 swift::TypeChecker::resolveType(swift::TypeRepr*, swift::DeclContext*, swift::OptionSet<swift::TypeResolutionFlags, unsigned int>, swift::GenericTypeResolver*, llvm::function_ref<bool (swift::TypeCheckRequest)>*) + 164
14 swift 0x0000000000f0e5d0 swift::TypeChecker::validateType(swift::TypeLoc&, swift::DeclContext*, swift::OptionSet<swift::TypeResolutionFlags, unsigned int>, swift::GenericTypeResolver*, llvm::function_ref<bool (swift::TypeCheckRequest)>*) + 192
16 swift 0x0000000000ee05e5 swift::TypeChecker::typeCheckParameterList(swift::ParameterList*, swift::DeclContext*, swift::OptionSet<swift::TypeResolutionFlags, unsigned int>, swift::GenericTypeResolver*) + 117
19 swift 0x0000000000e9cbe1 swift::TypeChecker::validateDecl(swift::ValueDecl*, bool) + 1089
20 swift 0x0000000000ea79cf swift::TypeChecker::addImplicitConstructors(swift::NominalTypeDecl*) + 607
23 swift 0x0000000000ea2156 swift::TypeChecker::typeCheckDecl(swift::Decl*, bool) + 150
26 swift 0x0000000000f088f4 swift::TypeChecker::typeCheckClosureBody(swift::ClosureExpr*) + 244
27 swift 0x0000000000f33ecc swift::constraints::ConstraintSystem::applySolution(swift::constraints::Solution&, swift::Expr*, swift::Type, bool, bool, bool) + 876
28 swift 0x0000000000e8fc21 swift::TypeChecker::typeCheckExpression(swift::Expr*&, swift::DeclContext*, swift::TypeLoc, swift::ContextualTypePurpose, swift::OptionSet<swift::TypeCheckExprFlags, unsigned int>, swift::ExprTypeCheckListener*) + 769
30 swift 0x0000000000f08a36 swift::TypeChecker::typeCheckTopLevelCodeDecl(swift::TopLevelCodeDecl*) + 134
31 swift 0x0000000000ec4b7d swift::performTypeChecking(swift::SourceFile&, swift::TopLevelContext&, swift::OptionSet<swift::TypeCheckingFlags, unsigned int>, unsigned int, unsigned int) + 1133
32 swift 0x0000000000c594c9 swift::CompilerInstance::performSema() + 3289
34 swift 0x00000000007d7739 swift::performFrontend(llvm::ArrayRef<char const*>, char const*, void*, swift::FrontendObserver*) + 2857
35 swift 0x00000000007a3748 main + 2872
Stack dump:
0. Program arguments: /path/to/swift/bin/swift -frontend -c -primary-file validation-test/compiler_crashers/28316-swift-typechecker-checkgenericparamlist.swift -target x86_64-unknown-linux-gnu -disable-objc-interop -module-name main -o /tmp/28316-swift-typechecker-checkgenericparamlist-2ebf90.o
1. While type-checking expression at [validation-test/compiler_crashers/28316-swift-typechecker-checkgenericparamlist.swift:9:1 - line:9:34] RangeText="{class B{init(T)}class T where g:a"
2. While type-checking 'B' at validation-test/compiler_crashers/28316-swift-typechecker-checkgenericparamlist.swift:9:2
3. While type-checking 'init' at validation-test/compiler_crashers/28316-swift-typechecker-checkgenericparamlist.swift:9:10
4. While resolving type T at [validation-test/compiler_crashers/28316-swift-typechecker-checkgenericparamlist.swift:9:15 - line:9:15] RangeText="T"
<unknown>:0: error: unable to execute command: Segmentation fault
<unknown>:0: error: compile command failed due to signal (use -v to see invocation)
```
|
||
|
|
bc0d7b5193 |
[swiftc] Add crash triggered in swift::DeclContext::isCascadingContextForLookup(bool) const. Bumps # of unresolved crash cases to 92.
Stack trace: ``` 4 swift 0x00000000010c2e67 swift::DeclContext::isCascadingContextForLookup(bool) const + 7 5 swift 0x00000000010c2e87 swift::DeclContext::isCascadingContextForLookup(bool) const + 39 6 swift 0x00000000010c2e87 swift::DeclContext::isCascadingContextForLookup(bool) const + 39 9 swift 0x0000000000f0e6de swift::TypeChecker::resolveIdentifierType(swift::DeclContext*, swift::IdentTypeRepr*, swift::OptionSet<swift::TypeResolutionFlags, unsigned int>, bool, swift::GenericTypeResolver*, llvm::function_ref<bool (swift::TypeCheckRequest)>*) + 158 11 swift 0x0000000000f0f7b4 swift::TypeChecker::resolveType(swift::TypeRepr*, swift::DeclContext*, swift::OptionSet<swift::TypeResolutionFlags, unsigned int>, swift::GenericTypeResolver*, llvm::function_ref<bool (swift::TypeCheckRequest)>*) + 164 12 swift 0x0000000000f0e5d0 swift::TypeChecker::validateType(swift::TypeLoc&, swift::DeclContext*, swift::OptionSet<swift::TypeResolutionFlags, unsigned int>, swift::GenericTypeResolver*, llvm::function_ref<bool (swift::TypeCheckRequest)>*) + 192 13 swift 0x0000000000eda0e2 swift::TypeChecker::checkGenericParamList(swift::ArchetypeBuilder*, swift::GenericParamList*, swift::GenericSignature*, bool, swift::GenericTypeResolver*) + 690 14 swift 0x0000000000edb6a7 swift::TypeChecker::validateGenericSignature(swift::GenericParamList*, swift::DeclContext*, swift::GenericSignature*, std::function<bool (swift::ArchetypeBuilder&)>, bool&) + 135 15 swift 0x0000000000edba46 swift::TypeChecker::validateGenericTypeSignature(swift::GenericTypeDecl*) + 102 16 swift 0x0000000000e9c90f swift::TypeChecker::validateDecl(swift::ValueDecl*, bool) + 367 20 swift 0x0000000000f0e6de swift::TypeChecker::resolveIdentifierType(swift::DeclContext*, swift::IdentTypeRepr*, swift::OptionSet<swift::TypeResolutionFlags, unsigned int>, bool, swift::GenericTypeResolver*, llvm::function_ref<bool (swift::TypeCheckRequest)>*) + 158 22 swift 0x0000000000f0f7b4 swift::TypeChecker::resolveType(swift::TypeRepr*, swift::DeclContext*, swift::OptionSet<swift::TypeResolutionFlags, unsigned int>, swift::GenericTypeResolver*, llvm::function_ref<bool (swift::TypeCheckRequest)>*) + 164 23 swift 0x0000000000f0e5d0 swift::TypeChecker::validateType(swift::TypeLoc&, swift::DeclContext*, swift::OptionSet<swift::TypeResolutionFlags, unsigned int>, swift::GenericTypeResolver*, llvm::function_ref<bool (swift::TypeCheckRequest)>*) + 192 24 swift 0x0000000000ee1527 swift::TypeChecker::typeCheckPattern(swift::Pattern*, swift::DeclContext*, swift::OptionSet<swift::TypeResolutionFlags, unsigned int>, swift::GenericTypeResolver*) + 967 29 swift 0x0000000000ea2156 swift::TypeChecker::typeCheckDecl(swift::Decl*, bool) + 150 32 swift 0x0000000000f0757a swift::TypeChecker::typeCheckFunctionBodyUntil(swift::FuncDecl*, swift::SourceLoc) + 346 33 swift 0x0000000000f073de swift::TypeChecker::typeCheckAbstractFunctionBodyUntil(swift::AbstractFunctionDecl*, swift::SourceLoc) + 46 34 swift 0x0000000000f07fa3 swift::TypeChecker::typeCheckAbstractFunctionBody(swift::AbstractFunctionDecl*) + 179 36 swift 0x0000000000ec4c11 swift::performTypeChecking(swift::SourceFile&, swift::TopLevelContext&, swift::OptionSet<swift::TypeCheckingFlags, unsigned int>, unsigned int, unsigned int) + 1281 37 swift 0x0000000000c594c9 swift::CompilerInstance::performSema() + 3289 39 swift 0x00000000007d7739 swift::performFrontend(llvm::ArrayRef<char const*>, char const*, void*, swift::FrontendObserver*) + 2857 40 swift 0x00000000007a3748 main + 2872 Stack dump: 0. Program arguments: /path/to/swift/bin/swift -frontend -c -primary-file validation-test/compiler_crashers/28315-swift-declcontext-iscascadingcontextforlookup.swift -target x86_64-unknown-linux-gnu -disable-objc-interop -module-name main -o /tmp/28315-swift-declcontext-iscascadingcontextforlookup-e789e8.o 1. While type-checking 'g' at validation-test/compiler_crashers/28315-swift-declcontext-iscascadingcontextforlookup.swift:31:1 2. While type-checking 'b' at validation-test/compiler_crashers/28315-swift-declcontext-iscascadingcontextforlookup.swift:72:9 3. While resolving type a at [validation-test/compiler_crashers/28315-swift-declcontext-iscascadingcontextforlookup.swift:152:5 - line:152:5] RangeText="a" 4. While resolving type g at [validation-test/compiler_crashers/28315-swift-declcontext-iscascadingcontextforlookup.swift:157:15 - line:157:15] RangeText="g" <unknown>:0: error: unable to execute command: Segmentation fault <unknown>:0: error: compile command failed due to signal (use -v to see invocation) ``` |
||
|
|
e2e7ef3c27 |
[swiftc] Add test case for crash triggered in swift::TypeChecker::checkGenericParamList(swift::ArchetypeBuilder*, swift::GenericParamList*, swift::GenericSignature*, bool, swift::GenericTypeResolver*)
Stack trace: ``` 4 swift 0x0000000000ed889d swift::TypeChecker::checkGenericParamList(swift::ArchetypeBuilder*, swift::GenericParamList*, swift::GenericSignature*, bool, swift::GenericTypeResolver*) + 93 6 swift 0x0000000000ed8fbe swift::TypeChecker::validateGenericFuncSignature(swift::AbstractFunctionDecl*) + 94 9 swift 0x0000000000e9b621 swift::TypeChecker::validateDecl(swift::ValueDecl*, bool) + 1089 11 swift 0x0000000000e9b621 swift::TypeChecker::validateDecl(swift::ValueDecl*, bool) + 1089 15 swift 0x0000000000f0d0ee swift::TypeChecker::resolveIdentifierType(swift::DeclContext*, swift::IdentTypeRepr*, swift::OptionSet<swift::TypeResolutionFlags, unsigned int>, bool, swift::GenericTypeResolver*, llvm::function_ref<bool (swift::TypeCheckRequest)>*) + 158 17 swift 0x0000000000f0e1c4 swift::TypeChecker::resolveType(swift::TypeRepr*, swift::DeclContext*, swift::OptionSet<swift::TypeResolutionFlags, unsigned int>, swift::GenericTypeResolver*, llvm::function_ref<bool (swift::TypeCheckRequest)>*) + 164 18 swift 0x0000000000f0cfe0 swift::TypeChecker::validateType(swift::TypeLoc&, swift::DeclContext*, swift::OptionSet<swift::TypeResolutionFlags, unsigned int>, swift::GenericTypeResolver*, llvm::function_ref<bool (swift::TypeCheckRequest)>*) + 192 19 swift 0x0000000000e9941a swift::TypeChecker::checkInheritanceClause(swift::Decl*, swift::GenericTypeResolver*) + 5370 20 swift 0x0000000000e9b3ef swift::TypeChecker::validateDecl(swift::ValueDecl*, bool) + 527 23 swift 0x0000000000ea0b66 swift::TypeChecker::typeCheckDecl(swift::Decl*, bool) + 150 24 swift 0x0000000000ec3522 swift::performTypeChecking(swift::SourceFile&, swift::TopLevelContext&, swift::OptionSet<swift::TypeCheckingFlags, unsigned int>, unsigned int, unsigned int) + 1026 25 swift 0x0000000000c580c9 swift::CompilerInstance::performSema() + 3289 27 swift 0x00000000007d7559 swift::performFrontend(llvm::ArrayRef<char const*>, char const*, void*, swift::FrontendObserver*) + 2857 28 swift 0x00000000007a3578 main + 2872 Stack dump: 0. Program arguments: /path/to/swift/bin/swift -frontend -c -primary-file validation-test/compiler_crashers/28314-swift-typechecker-checkgenericparamlist.swift -target x86_64-unknown-linux-gnu -disable-objc-interop -module-name main -o /tmp/28314-swift-typechecker-checkgenericparamlist-196feb.o 1. While type-checking 'A' at validation-test/compiler_crashers/28314-swift-typechecker-checkgenericparamlist.swift:10:1 2. While resolving type e at [validation-test/compiler_crashers/28314-swift-typechecker-checkgenericparamlist.swift:10:9 - line:10:9] RangeText="e" 3. While type-checking 'e' at validation-test/compiler_crashers/28314-swift-typechecker-checkgenericparamlist.swift:13:1 4. While type-checking 'e' at validation-test/compiler_crashers/28314-swift-typechecker-checkgenericparamlist.swift:11:1 <unknown>:0: error: unable to execute command: Segmentation fault <unknown>:0: error: compile command failed due to signal (use -v to see invocation) ``` |
||
|
|
31943020f3 |
[swiftc] Add test case for crash triggered in swift::TypeChecker::checkGenericParamList(swift::ArchetypeBuilder*, swift::GenericParamList*, swift::GenericSignature*, bool, swift::GenericTypeResolver*)
Stack trace: ``` 4 swift 0x0000000000ed89fd swift::TypeChecker::checkGenericParamList(swift::ArchetypeBuilder*, swift::GenericParamList*, swift::GenericSignature*, bool, swift::GenericTypeResolver*) + 93 6 swift 0x0000000000ed911e swift::TypeChecker::validateGenericFuncSignature(swift::AbstractFunctionDecl*) + 94 9 swift 0x0000000000e9b781 swift::TypeChecker::validateDecl(swift::ValueDecl*, bool) + 1089 11 swift 0x0000000000e9b781 swift::TypeChecker::validateDecl(swift::ValueDecl*, bool) + 1089 16 swift 0x00000000010d52e6 swift::lookupVisibleDecls(swift::VisibleDeclConsumer&, swift::DeclContext const*, swift::LazyResolver*, bool, swift::SourceLoc) + 1174 17 swift 0x0000000000edd6f4 swift::TypeChecker::performTypoCorrection(swift::DeclContext*, swift::DeclRefKind, swift::DeclName, swift::SourceLoc, swift::OptionSet<swift::NameLookupFlags, unsigned int>, swift::LookupResult&, unsigned int) + 260 18 swift 0x0000000000e874b8 swift::TypeChecker::resolveDeclRefExpr(swift::UnresolvedDeclRefExpr*, swift::DeclContext*) + 3864 21 swift 0x0000000001052c1e swift::Expr::walk(swift::ASTWalker&) + 46 22 swift 0x0000000000e87d40 swift::TypeChecker::solveForExpression(swift::Expr*&, swift::DeclContext*, swift::Type, swift::FreeTypeVariableBinding, swift::ExprTypeCheckListener*, swift::constraints::ConstraintSystem&, llvm::SmallVectorImpl<swift::constraints::Solution>&, swift::OptionSet<swift::TypeCheckExprFlags, unsigned int>) + 224 23 swift 0x0000000000e8e712 swift::TypeChecker::typeCheckExpression(swift::Expr*&, swift::DeclContext*, swift::TypeLoc, swift::ContextualTypePurpose, swift::OptionSet<swift::TypeCheckExprFlags, unsigned int>, swift::ExprTypeCheckListener*) + 610 24 swift 0x0000000000e8f867 swift::TypeChecker::typeCheckBinding(swift::Pattern*&, swift::Expr*&, swift::DeclContext*) + 343 25 swift 0x0000000000e8fa7b swift::TypeChecker::typeCheckPatternBinding(swift::PatternBindingDecl*, unsigned int) + 267 27 swift 0x0000000000e9c379 swift::TypeChecker::validateDecl(swift::ValueDecl*, bool) + 4153 28 swift 0x0000000000f1f57d swift::createImplicitConstructor(swift::TypeChecker&, swift::NominalTypeDecl*, swift::ImplicitConstructorKind) + 413 29 swift 0x0000000000ea68e0 swift::TypeChecker::addImplicitConstructors(swift::NominalTypeDecl*) + 1536 44 swift 0x0000000000ea0cc6 swift::TypeChecker::typeCheckDecl(swift::Decl*, bool) + 150 45 swift 0x0000000000ec36a2 swift::performTypeChecking(swift::SourceFile&, swift::TopLevelContext&, swift::OptionSet<swift::TypeCheckingFlags, unsigned int>, unsigned int, unsigned int) + 1026 46 swift 0x0000000000c58169 swift::CompilerInstance::performSema() + 3289 48 swift 0x00000000007d7499 swift::performFrontend(llvm::ArrayRef<char const*>, char const*, void*, swift::FrontendObserver*) + 2857 49 swift 0x00000000007a34b8 main + 2872 Stack dump: 0. Program arguments: /path/to/swift/bin/swift -frontend -c -primary-file validation-test/compiler_crashers/28313-swift-typechecker-checkgenericparamlist.swift -target x86_64-unknown-linux-gnu -disable-objc-interop -module-name main -o /tmp/28313-swift-typechecker-checkgenericparamlist-935374.o 1. While type-checking 'a' at validation-test/compiler_crashers/28313-swift-typechecker-checkgenericparamlist.swift:10:1 2. While type-checking expression at [validation-test/compiler_crashers/28313-swift-typechecker-checkgenericparamlist.swift:42:9 - line:42:11] RangeText="c<I" 3. While type-checking 'f' at validation-test/compiler_crashers/28313-swift-typechecker-checkgenericparamlist.swift:18:1 4. While type-checking 'f' at validation-test/compiler_crashers/28313-swift-typechecker-checkgenericparamlist.swift:80:1 <unknown>:0: error: unable to execute command: Segmentation fault <unknown>:0: error: compile command failed due to signal (use -v to see invocation) ``` |
||
|
|
bbefeb2fc5 |
Sema: Better support for nested generic functions
There was a weird corner case with nested generic functions that would fail in the SIL verifier with some nonsense about archetypes out of context. Fix this the "right" way, by re-working Sema function declaration validation to assign generic signatures in a more principled way. Previously, nested functions did not get an interface type unless they themselves had generic parameters. This was inconsistent with methods nested inside generic types, which did get an interface type even if they themselves did not have a generic parameter list. There's some spill-over in SILGen from this change. Mostly it makes things more consistent and fixes some corner cases. |
||
|
|
46ae21513f |
[swiftc] Add test case for crash triggered in swift::TypeChecker::checkGenericParamList(swift::ArchetypeBuilder*, swift::GenericParamList*, swift::GenericSignature*, bool, swift::GenericTypeResolver*)
Stack trace: ``` 4 swift 0x0000000000ed89bd swift::TypeChecker::checkGenericParamList(swift::ArchetypeBuilder*, swift::GenericParamList*, swift::GenericSignature*, bool, swift::GenericTypeResolver*) + 93 6 swift 0x0000000000ed90de swift::TypeChecker::validateGenericFuncSignature(swift::AbstractFunctionDecl*) + 94 9 swift 0x0000000000e9b741 swift::TypeChecker::validateDecl(swift::ValueDecl*, bool) + 1089 10 swift 0x00000000010f587c swift::DeclContext::lookupQualified(swift::Type, swift::DeclName, swift::NLOptions, swift::LazyResolver*, llvm::SmallVectorImpl<swift::ValueDecl*>&) const + 2652 11 swift 0x0000000000edcf37 swift::TypeChecker::lookupMemberType(swift::DeclContext*, swift::Type, swift::Identifier, swift::OptionSet<swift::NameLookupFlags, unsigned int>) + 295 13 swift 0x0000000000f0d47e swift::TypeChecker::resolveIdentifierType(swift::DeclContext*, swift::IdentTypeRepr*, swift::OptionSet<swift::TypeResolutionFlags, unsigned int>, bool, swift::GenericTypeResolver*, llvm::function_ref<bool (swift::TypeCheckRequest)>*) + 158 15 swift 0x0000000000f0e554 swift::TypeChecker::resolveType(swift::TypeRepr*, swift::DeclContext*, swift::OptionSet<swift::TypeResolutionFlags, unsigned int>, swift::GenericTypeResolver*, llvm::function_ref<bool (swift::TypeCheckRequest)>*) + 164 16 swift 0x0000000000f0d370 swift::TypeChecker::validateType(swift::TypeLoc&, swift::DeclContext*, swift::OptionSet<swift::TypeResolutionFlags, unsigned int>, swift::GenericTypeResolver*, llvm::function_ref<bool (swift::TypeCheckRequest)>*) + 192 17 swift 0x0000000000e9953a swift::TypeChecker::checkInheritanceClause(swift::Decl*, swift::GenericTypeResolver*) + 5370 18 swift 0x0000000000e9b50f swift::TypeChecker::validateDecl(swift::ValueDecl*, bool) + 527 21 swift 0x0000000000ea0c86 swift::TypeChecker::typeCheckDecl(swift::Decl*, bool) + 150 24 swift 0x0000000000f060aa swift::TypeChecker::typeCheckFunctionBodyUntil(swift::FuncDecl*, swift::SourceLoc) + 346 25 swift 0x0000000000f05f0e swift::TypeChecker::typeCheckAbstractFunctionBodyUntil(swift::AbstractFunctionDecl*, swift::SourceLoc) + 46 26 swift 0x0000000000f06ad3 swift::TypeChecker::typeCheckAbstractFunctionBody(swift::AbstractFunctionDecl*) + 179 28 swift 0x0000000000ec3761 swift::performTypeChecking(swift::SourceFile&, swift::TopLevelContext&, swift::OptionSet<swift::TypeCheckingFlags, unsigned int>, unsigned int, unsigned int) + 1281 29 swift 0x0000000000c58169 swift::CompilerInstance::performSema() + 3289 31 swift 0x00000000007d7499 swift::performFrontend(llvm::ArrayRef<char const*>, char const*, void*, swift::FrontendObserver*) + 2857 32 swift 0x00000000007a34b8 main + 2872 Stack dump: 0. Program arguments: /path/to/swift/bin/swift -frontend -c -primary-file validation-test/compiler_crashers/28312-swift-typechecker-checkgenericparamlist.swift -target x86_64-unknown-linux-gnu -disable-objc-interop -module-name main -o /tmp/28312-swift-typechecker-checkgenericparamlist-dcf2e2.o 1. While type-checking getter for w at validation-test/compiler_crashers/28312-swift-typechecker-checkgenericparamlist.swift:10:6 2. While type-checking 'c' at validation-test/compiler_crashers/28312-swift-typechecker-checkgenericparamlist.swift:10:7 3. While resolving type A.b at [validation-test/compiler_crashers/28312-swift-typechecker-checkgenericparamlist.swift:10:15 - line:10:17] RangeText="A.b" 4. While type-checking 'b' at validation-test/compiler_crashers/28312-swift-typechecker-checkgenericparamlist.swift:10:27 <unknown>:0: error: unable to execute command: Segmentation fault <unknown>:0: error: compile command failed due to signal (use -v to see invocation) ``` |
||
|
|
3127264376 |
AST: When performing qualified lookup of a member type, filter out non-types earlier
With the previous resolveTypeInContext() patch, a few compiler
crashers regressed with this problem, presumably because we were now
performing lookups in more contexts than before.
This is a class of problems where we would attempt a recursive
validation:
1) Generic signature validation begins for type T
2) Name lookup in type context finds a non-type declaration D nested in T
3) Generic signature validation begins for D
4) The outer generic context of D is T, but T doesn't have a generic
signature yet
The right way to break such cycles is to implement the iterative
decl checker design. However when the recursion is via name lookup,
we can try to avoid the problem in the first place by not validating
non-type declarations if the client requested a type-only lookup.
Note that there is a small semantic change here, where programs that
were previously rejected as invalid because of name clashes are
now valid. It is arguable if we want to allow stuff like this or not:
class A {
func A(a: A) {}
}
or
class Case {}
enum Foo {
case Case(Case)
}
However at the very least, the new behavior is better because it
gives us an opportunity to add a diagnostic in the right place
later. The old diagnostics were not very good, for example the
second example just yields "use of undeclared type 'Case'".
In other examples, the undeclared type diagnostic would come up
multiple times, or we would generate a cryptic "type 'A' used within
its own definition".
As far as I understand, this should not change behavior of any existing
valid code.
|
||
|
|
e8abf54a9a |
Sema: Fixes for protocol typealiases
This is a big refactoring of resolveTypeInContext() which makes
the function clearer to understand by merging various special
cases and generalizing the logic for walking parent and superclass
contexts to cover more cases.
This improves typealiases in protocols a bit:
1) Previously a typealias in a protocol either had to be concrete,
or consist of a single path of member types from Self, eg
Self.A.B. Lift this restriction, so we can now write things like
protocol Fireworks {
associatedtype Exploding
typealias Exploder = Exploding -> [Exploding]
}
2) Protocol typealiases can now be accessed via qualified lookup
on concrete types. Getting this working for unqualified lookup
requires further refactorings which will be in a subsequent
patch.
|
||
|
|
3c41785f51 |
[swiftc] Add test case for crash triggered in swift::TypeChecker::checkGenericParamList(swift::ArchetypeBuilder*, swift::GenericParamList*, swift::GenericSignature*, bool, swift::GenericTypeResolver*)
Stack trace: ``` 4 swift 0x0000000000ed889d swift::TypeChecker::checkGenericParamList(swift::ArchetypeBuilder*, swift::GenericParamList*, swift::GenericSignature*, bool, swift::GenericTypeResolver*) + 93 5 swift 0x0000000000eda0b7 swift::TypeChecker::validateGenericSignature(swift::GenericParamList*, swift::DeclContext*, swift::GenericSignature*, std::function<bool (swift::ArchetypeBuilder&)>, bool&) + 135 6 swift 0x0000000000eda456 swift::TypeChecker::validateGenericTypeSignature(swift::GenericTypeDecl*) + 102 7 swift 0x0000000000e9b34f swift::TypeChecker::validateDecl(swift::ValueDecl*, bool) + 367 8 swift 0x00000000010f4c5c swift::DeclContext::lookupQualified(swift::Type, swift::DeclName, swift::NLOptions, swift::LazyResolver*, llvm::SmallVectorImpl<swift::ValueDecl*>&) const + 2652 9 swift 0x0000000000edce17 swift::TypeChecker::lookupMemberType(swift::DeclContext*, swift::Type, swift::Identifier, swift::OptionSet<swift::NameLookupFlags, unsigned int>) + 295 12 swift 0x0000000000ee6aaf swift::TypeChecker::checkConformance(swift::NormalProtocolConformance*) + 1631 13 swift 0x0000000000ee71a7 swift::TypeChecker::checkConformancesInContext(swift::DeclContext*, swift::IterableDeclContext*) + 471 16 swift 0x0000000000ea0b66 swift::TypeChecker::typeCheckDecl(swift::Decl*, bool) + 150 19 swift 0x0000000000f05f8a swift::TypeChecker::typeCheckFunctionBodyUntil(swift::FuncDecl*, swift::SourceLoc) + 346 20 swift 0x0000000000f05dee swift::TypeChecker::typeCheckAbstractFunctionBodyUntil(swift::AbstractFunctionDecl*, swift::SourceLoc) + 46 21 swift 0x0000000000f069b3 swift::TypeChecker::typeCheckAbstractFunctionBody(swift::AbstractFunctionDecl*) + 179 23 swift 0x0000000000ec3641 swift::performTypeChecking(swift::SourceFile&, swift::TopLevelContext&, swift::OptionSet<swift::TypeCheckingFlags, unsigned int>, unsigned int, unsigned int) + 1281 24 swift 0x0000000000c58089 swift::CompilerInstance::performSema() + 3289 26 swift 0x00000000007d7409 swift::performFrontend(llvm::ArrayRef<char const*>, char const*, void*, swift::FrontendObserver*) + 2857 27 swift 0x00000000007a3428 main + 2872 Stack dump: 0. Program arguments: /path/to/swift/bin/swift -frontend -c -primary-file validation-test/compiler_crashers/28311-swift-typechecker-checkgenericparamlist.swift -target x86_64-unknown-linux-gnu -disable-objc-interop -module-name main -o /tmp/28311-swift-typechecker-checkgenericparamlist-bbd21e.o 1. While type-checking 'b' at validation-test/compiler_crashers/28311-swift-typechecker-checkgenericparamlist.swift:10:24 2. While type-checking 'b' at validation-test/compiler_crashers/28311-swift-typechecker-checkgenericparamlist.swift:10:33 <unknown>:0: error: unable to execute command: Segmentation fault <unknown>:0: error: compile command failed due to signal (use -v to see invocation) ``` |
||
|
|
1fa929deee |
[swiftc] Add test case for crash triggered in swift::TypeChecker::checkGenericParamList(swift::ArchetypeBuilder*, swift::GenericParamList*, swift::GenericSignature*, bool, swift::GenericTypeResolver*)
Stack trace: ``` 4 swift 0x0000000000ed9e1d swift::TypeChecker::checkGenericParamList(swift::ArchetypeBuilder*, swift::GenericParamList*, swift::GenericSignature*, bool, swift::GenericTypeResolver*) + 93 6 swift 0x0000000000eda53e swift::TypeChecker::validateGenericFuncSignature(swift::AbstractFunctionDecl*) + 94 9 swift 0x0000000000e9cc21 swift::TypeChecker::validateDecl(swift::ValueDecl*, bool) + 1089 11 swift 0x0000000000e9cc21 swift::TypeChecker::validateDecl(swift::ValueDecl*, bool) + 1089 16 swift 0x00000000010d6016 swift::lookupVisibleDecls(swift::VisibleDeclConsumer&, swift::DeclContext const*, swift::LazyResolver*, bool, swift::SourceLoc) + 1174 17 swift 0x0000000000edeaa4 swift::TypeChecker::performTypoCorrection(swift::DeclContext*, swift::DeclRefKind, swift::DeclName, swift::SourceLoc, swift::OptionSet<swift::NameLookupFlags, unsigned int>, swift::LookupResult&, unsigned int) + 260 18 swift 0x0000000000e88998 swift::TypeChecker::resolveDeclRefExpr(swift::UnresolvedDeclRefExpr*, swift::DeclContext*) + 3864 21 swift 0x00000000010538fe swift::Expr::walk(swift::ASTWalker&) + 46 22 swift 0x0000000000e89220 swift::TypeChecker::solveForExpression(swift::Expr*&, swift::DeclContext*, swift::Type, swift::FreeTypeVariableBinding, swift::ExprTypeCheckListener*, swift::constraints::ConstraintSystem&, llvm::SmallVectorImpl<swift::constraints::Solution>&, swift::OptionSet<swift::TypeCheckExprFlags, unsigned int>) + 224 23 swift 0x0000000000e8fbf2 swift::TypeChecker::typeCheckExpression(swift::Expr*&, swift::DeclContext*, swift::TypeLoc, swift::ContextualTypePurpose, swift::OptionSet<swift::TypeCheckExprFlags, unsigned int>, swift::ExprTypeCheckListener*) + 610 24 swift 0x0000000000e90d47 swift::TypeChecker::typeCheckBinding(swift::Pattern*&, swift::Expr*&, swift::DeclContext*) + 343 25 swift 0x0000000000e90f5b swift::TypeChecker::typeCheckPatternBinding(swift::PatternBindingDecl*, unsigned int) + 267 27 swift 0x0000000000e9d819 swift::TypeChecker::validateDecl(swift::ValueDecl*, bool) + 4153 28 swift 0x0000000000f207cd swift::createImplicitConstructor(swift::TypeChecker&, swift::NominalTypeDecl*, swift::ImplicitConstructorKind) + 413 29 swift 0x0000000000ea7d76 swift::TypeChecker::addImplicitConstructors(swift::NominalTypeDecl*) + 1526 44 swift 0x0000000000ea2166 swift::TypeChecker::typeCheckDecl(swift::Decl*, bool) + 150 45 swift 0x0000000000ec4ac2 swift::performTypeChecking(swift::SourceFile&, swift::TopLevelContext&, swift::OptionSet<swift::TypeCheckingFlags, unsigned int>, unsigned int, unsigned int) + 1026 46 swift 0x0000000000c58d39 swift::CompilerInstance::performSema() + 3289 48 swift 0x00000000007d73bf swift::performFrontend(llvm::ArrayRef<char const*>, char const*, void*, swift::FrontendObserver*) + 2863 49 swift 0x00000000007a33d8 main + 2872 Stack dump: 0. Program arguments: /path/to/swift/bin/swift -frontend -c -primary-file validation-test/compiler_crashers/28310-swift-typechecker-checkgenericparamlist.swift -target x86_64-unknown-linux-gnu -disable-objc-interop -module-name main -o /tmp/28310-swift-typechecker-checkgenericparamlist-83e1a2.o 1. While type-checking 'a' at validation-test/compiler_crashers/28310-swift-typechecker-checkgenericparamlist.swift:10:1 2. While type-checking expression at [validation-test/compiler_crashers/28310-swift-typechecker-checkgenericparamlist.swift:42:9 - line:42:11] RangeText="c<I" 3. While type-checking 'f' at validation-test/compiler_crashers/28310-swift-typechecker-checkgenericparamlist.swift:18:1 4. While type-checking 'f' at validation-test/compiler_crashers/28310-swift-typechecker-checkgenericparamlist.swift:80:1 <unknown>:0: error: unable to execute command: Segmentation fault <unknown>:0: error: compile command failed due to signal (use -v to see invocation) ``` |
||
|
|
7eafd46552 |
[swiftc] Add test case for crash triggered in swift::TypeChecker::addImplicitConstructors(swift::NominalTypeDecl*)
Stack trace: ``` swift: /path/to/swift/lib/AST/DiagnosticEngine.cpp:549: void swift::DiagnosticEngine::flushActiveDiagnostic(): Assertion `ActiveDiagnostic && "No active diagnostic to flush"' failed. 10 swift 0x0000000000ea7db9 swift::TypeChecker::addImplicitConstructors(swift::NominalTypeDecl*) + 1593 11 swift 0x00000000010b8197 swift::ClassDecl::inheritsSuperclassInitializers(swift::LazyResolver*) + 231 14 swift 0x00000000010d6016 swift::lookupVisibleDecls(swift::VisibleDeclConsumer&, swift::DeclContext const*, swift::LazyResolver*, bool, swift::SourceLoc) + 1174 15 swift 0x0000000000edeaa4 swift::TypeChecker::performTypoCorrection(swift::DeclContext*, swift::DeclRefKind, swift::DeclName, swift::SourceLoc, swift::OptionSet<swift::NameLookupFlags, unsigned int>, swift::LookupResult&, unsigned int) + 260 16 swift 0x0000000000e88998 swift::TypeChecker::resolveDeclRefExpr(swift::UnresolvedDeclRefExpr*, swift::DeclContext*) + 3864 18 swift 0x00000000010538e3 swift::Expr::walk(swift::ASTWalker&) + 19 19 swift 0x0000000000e89220 swift::TypeChecker::solveForExpression(swift::Expr*&, swift::DeclContext*, swift::Type, swift::FreeTypeVariableBinding, swift::ExprTypeCheckListener*, swift::constraints::ConstraintSystem&, llvm::SmallVectorImpl<swift::constraints::Solution>&, swift::OptionSet<swift::TypeCheckExprFlags, unsigned int>) + 224 20 swift 0x0000000000e8fbf2 swift::TypeChecker::typeCheckExpression(swift::Expr*&, swift::DeclContext*, swift::TypeLoc, swift::ContextualTypePurpose, swift::OptionSet<swift::TypeCheckExprFlags, unsigned int>, swift::ExprTypeCheckListener*) + 610 21 swift 0x0000000000e90d47 swift::TypeChecker::typeCheckBinding(swift::Pattern*&, swift::Expr*&, swift::DeclContext*) + 343 22 swift 0x0000000000e90f5b swift::TypeChecker::typeCheckPatternBinding(swift::PatternBindingDecl*, unsigned int) + 267 24 swift 0x0000000000e9d819 swift::TypeChecker::validateDecl(swift::ValueDecl*, bool) + 4153 25 swift 0x00000000010f636c swift::DeclContext::lookupQualified(swift::Type, swift::DeclName, swift::NLOptions, swift::LazyResolver*, llvm::SmallVectorImpl<swift::ValueDecl*>&) const + 2652 26 swift 0x00000000010f4c05 swift::UnqualifiedLookup::UnqualifiedLookup(swift::DeclName, swift::DeclContext*, swift::LazyResolver*, bool, swift::SourceLoc, bool, bool) + 2469 27 swift 0x0000000000edd69b swift::TypeChecker::lookupUnqualified(swift::DeclContext*, swift::DeclName, swift::SourceLoc, swift::OptionSet<swift::NameLookupFlags, unsigned int>) + 187 30 swift 0x0000000000f0e8ae swift::TypeChecker::resolveIdentifierType(swift::DeclContext*, swift::IdentTypeRepr*, swift::OptionSet<swift::TypeResolutionFlags, unsigned int>, bool, swift::GenericTypeResolver*, llvm::function_ref<bool (swift::TypeCheckRequest)>*) + 158 32 swift 0x0000000000f0f8b4 swift::TypeChecker::resolveType(swift::TypeRepr*, swift::DeclContext*, swift::OptionSet<swift::TypeResolutionFlags, unsigned int>, swift::GenericTypeResolver*, llvm::function_ref<bool (swift::TypeCheckRequest)>*) + 164 33 swift 0x0000000000f0e7a0 swift::TypeChecker::validateType(swift::TypeLoc&, swift::DeclContext*, swift::OptionSet<swift::TypeResolutionFlags, unsigned int>, swift::GenericTypeResolver*, llvm::function_ref<bool (swift::TypeCheckRequest)>*) + 192 34 swift 0x0000000000e9aa1a swift::TypeChecker::checkInheritanceClause(swift::Decl*, swift::GenericTypeResolver*) + 5370 35 swift 0x0000000000e9c9ef swift::TypeChecker::validateDecl(swift::ValueDecl*, bool) + 527 40 swift 0x0000000000ea2166 swift::TypeChecker::typeCheckDecl(swift::Decl*, bool) + 150 41 swift 0x0000000000ec4ac2 swift::performTypeChecking(swift::SourceFile&, swift::TopLevelContext&, swift::OptionSet<swift::TypeCheckingFlags, unsigned int>, unsigned int, unsigned int) + 1026 42 swift 0x0000000000c58d39 swift::CompilerInstance::performSema() + 3289 44 swift 0x00000000007d73bf swift::performFrontend(llvm::ArrayRef<char const*>, char const*, void*, swift::FrontendObserver*) + 2863 45 swift 0x00000000007a33d8 main + 2872 Stack dump: 0. Program arguments: /path/to/swift/bin/swift -frontend -c -primary-file validation-test/compiler_crashers/28309-swift-typechecker-addimplicitconstructors.swift -target x86_64-unknown-linux-gnu -disable-objc-interop -module-name main -o /tmp/28309-swift-typechecker-addimplicitconstructors-da3b4e.o 1. While type-checking 'A' at validation-test/compiler_crashers/28309-swift-typechecker-addimplicitconstructors.swift:11:1 2. While resolving type a at [validation-test/compiler_crashers/28309-swift-typechecker-addimplicitconstructors.swift:12:9 - line:12:9] RangeText="a" 3. While type-checking expression at [validation-test/compiler_crashers/28309-swift-typechecker-addimplicitconstructors.swift:13:7 - line:13:7] RangeText="D" <unknown>:0: error: unable to execute command: Aborted <unknown>:0: error: compile command failed due to signal (use -v to see invocation) ``` |
||
|
|
ddd457c14a |
[swiftc] Add test case for crash triggered in swift::TypeChecker::checkGenericParamList(swift::ArchetypeBuilder*, swift::GenericParamList*, swift::GenericSignature*, bool, swift::GenericTypeResolver*)
Stack trace: ``` 4 swift 0x0000000000ed9e0a swift::TypeChecker::checkGenericParamList(swift::ArchetypeBuilder*, swift::GenericParamList*, swift::GenericSignature*, bool, swift::GenericTypeResolver*) + 74 5 swift 0x0000000000edb637 swift::TypeChecker::validateGenericSignature(swift::GenericParamList*, swift::DeclContext*, swift::GenericSignature*, std::function<bool (swift::ArchetypeBuilder&)>, bool&) + 135 6 swift 0x0000000000edb9d6 swift::TypeChecker::validateGenericTypeSignature(swift::GenericTypeDecl*) + 102 7 swift 0x0000000000e9c94f swift::TypeChecker::validateDecl(swift::ValueDecl*, bool) + 367 12 swift 0x0000000000ea2166 swift::TypeChecker::typeCheckDecl(swift::Decl*, bool) + 150 13 swift 0x0000000000ec4ac2 swift::performTypeChecking(swift::SourceFile&, swift::TopLevelContext&, swift::OptionSet<swift::TypeCheckingFlags, unsigned int>, unsigned int, unsigned int) + 1026 14 swift 0x0000000000c58d39 swift::CompilerInstance::performSema() + 3289 16 swift 0x00000000007d73bf swift::performFrontend(llvm::ArrayRef<char const*>, char const*, void*, swift::FrontendObserver*) + 2863 17 swift 0x00000000007a33d8 main + 2872 Stack dump: 0. Program arguments: /path/to/swift/bin/swift -frontend -c -primary-file validation-test/compiler_crashers/28308-swift-typechecker-checkgenericparamlist.swift -target x86_64-unknown-linux-gnu -disable-objc-interop -module-name main -o /tmp/28308-swift-typechecker-checkgenericparamlist-b4f9c8.o 1. While type-checking 'B' at validation-test/compiler_crashers/28308-swift-typechecker-checkgenericparamlist.swift:9:1 <unknown>:0: error: unable to execute command: Segmentation fault <unknown>:0: error: compile command failed due to signal (use -v to see invocation) ``` |
||
|
|
b508b89927 |
[swiftc] Add test case for crash triggered in swift::TypeChecker::checkGenericParamList(swift::ArchetypeBuilder*, swift::GenericParamList*, swift::GenericSignature*, bool, swift::GenericTypeResolver*)
Stack trace: ``` 4 swift 0x0000000000ed9ded swift::TypeChecker::checkGenericParamList(swift::ArchetypeBuilder*, swift::GenericParamList*, swift::GenericSignature*, bool, swift::GenericTypeResolver*) + 93 6 swift 0x0000000000eda50e swift::TypeChecker::validateGenericFuncSignature(swift::AbstractFunctionDecl*) + 94 11 swift 0x0000000000ea2136 swift::TypeChecker::typeCheckDecl(swift::Decl*, bool) + 150 12 swift 0x0000000000ec4a92 swift::performTypeChecking(swift::SourceFile&, swift::TopLevelContext&, swift::OptionSet<swift::TypeCheckingFlags, unsigned int>, unsigned int, unsigned int) + 1026 13 swift 0x0000000000c58d09 swift::CompilerInstance::performSema() + 3289 15 swift 0x00000000007d735f swift::performFrontend(llvm::ArrayRef<char const*>, char const*, void*, swift::FrontendObserver*) + 2863 16 swift 0x00000000007a3378 main + 2872 Stack dump: 0. Program arguments: /path/to/swift/bin/swift -frontend -c -primary-file validation-test/compiler_crashers/28307-swift-typechecker-resolveidentifiertype.swift -target x86_64-unknown-linux-gnu -disable-objc-interop -module-name main -o /tmp/28307-swift-typechecker-resolveidentifiertype-687f0c.o 1. While type-checking 'A' at validation-test/compiler_crashers/28307-swift-typechecker-resolveidentifiertype.swift:66:21 <unknown>:0: error: unable to execute command: Segmentation fault <unknown>:0: error: compile command failed due to signal (use -v to see invocation) ``` |
||
|
|
318abe0920 |
[validation-test] Move a 'compiler_crashers' test to 'compiler_crashers_fixed'.
This may have non-deterministic behavior, but it's not crashing now. |
||
|
|
1105336e49 |
[swiftc] Add test case for crash triggered in swift::lookupVisibleDecls(swift::VisibleDeclConsumer&, swift::DeclContext const*, swift::LazyResolver*, bool, swift::SourceLoc)
Stack trace:
```
swift: /path/to/swift/lib/AST/LookupVisibleDecls.cpp:525: void lookupVisibleMemberDeclsImpl(swift::Type, swift::VisibleDeclConsumer &, const swift::DeclContext *, (anonymous namespace)::LookupState, swift::DeclVisibilityKind, swift::LazyResolver *, VisitedSet &): Assertion `BaseTy.getPointer() != CurClass->getSuperclass().getPointer() && "type is its own superclass"' failed.
10 swift 0x00000000010d5466 swift::lookupVisibleDecls(swift::VisibleDeclConsumer&, swift::DeclContext const*, swift::LazyResolver*, bool, swift::SourceLoc) + 1174
11 swift 0x0000000000ede784 swift::TypeChecker::performTypoCorrection(swift::DeclContext*, swift::DeclRefKind, swift::DeclName, swift::SourceLoc, swift::OptionSet<swift::NameLookupFlags, unsigned int>, swift::LookupResult&, unsigned int) + 260
12 swift 0x0000000000e88878 swift::TypeChecker::resolveDeclRefExpr(swift::UnresolvedDeclRefExpr*, swift::DeclContext*) + 3864
14 swift 0x0000000001052c13 swift::Expr::walk(swift::ASTWalker&) + 19
15 swift 0x0000000000e89097 swift::TypeChecker::solveForExpression(swift::Expr*&, swift::DeclContext*, swift::Type, swift::FreeTypeVariableBinding, swift::ExprTypeCheckListener*, swift::constraints::ConstraintSystem&, llvm::SmallVectorImpl<swift::constraints::Solution>&, swift::OptionSet<swift::TypeCheckExprFlags, unsigned int>) + 119
16 swift 0x0000000000e8fa52 swift::TypeChecker::typeCheckExpression(swift::Expr*&, swift::DeclContext*, swift::TypeLoc, swift::ContextualTypePurpose, swift::OptionSet<swift::TypeCheckExprFlags, unsigned int>, swift::ExprTypeCheckListener*) + 610
17 swift 0x0000000000e90ba7 swift::TypeChecker::typeCheckBinding(swift::Pattern*&, swift::Expr*&, swift::DeclContext*) + 343
18 swift 0x0000000000e90dbb swift::TypeChecker::typeCheckPatternBinding(swift::PatternBindingDecl*, unsigned int) + 267
20 swift 0x0000000000e9d4f9 swift::TypeChecker::validateDecl(swift::ValueDecl*, bool) + 4153
21 swift 0x00000000010f57bc swift::DeclContext::lookupQualified(swift::Type, swift::DeclName, swift::NLOptions, swift::LazyResolver*, llvm::SmallVectorImpl<swift::ValueDecl*>&) const + 2652
22 swift 0x0000000000ede077 swift::TypeChecker::lookupMemberType(swift::DeclContext*, swift::Type, swift::Identifier, swift::OptionSet<swift::NameLookupFlags, unsigned int>) + 295
24 swift 0x0000000000f0e50e swift::TypeChecker::resolveIdentifierType(swift::DeclContext*, swift::IdentTypeRepr*, swift::OptionSet<swift::TypeResolutionFlags, unsigned int>, bool, swift::GenericTypeResolver*, llvm::function_ref<bool (swift::TypeCheckRequest)>*) + 158
26 swift 0x0000000000f0f514 swift::TypeChecker::resolveType(swift::TypeRepr*, swift::DeclContext*, swift::OptionSet<swift::TypeResolutionFlags, unsigned int>, swift::GenericTypeResolver*, llvm::function_ref<bool (swift::TypeCheckRequest)>*) + 164
27 swift 0x0000000000f0e400 swift::TypeChecker::validateType(swift::TypeLoc&, swift::DeclContext*, swift::OptionSet<swift::TypeResolutionFlags, unsigned int>, swift::GenericTypeResolver*, llvm::function_ref<bool (swift::TypeCheckRequest)>*) + 192
28 swift 0x0000000000ee1167 swift::TypeChecker::typeCheckPattern(swift::Pattern*, swift::DeclContext*, swift::OptionSet<swift::TypeResolutionFlags, unsigned int>, swift::GenericTypeResolver*) + 967
31 swift 0x0000000000ea1e46 swift::TypeChecker::typeCheckDecl(swift::Decl*, bool) + 150
34 swift 0x0000000000f08504 swift::TypeChecker::typeCheckClosureBody(swift::ClosureExpr*) + 244
35 swift 0x0000000000f3336c swift::constraints::ConstraintSystem::applySolution(swift::constraints::Solution&, swift::Expr*, swift::Type, bool, bool, bool) + 876
36 swift 0x0000000000e8faf1 swift::TypeChecker::typeCheckExpression(swift::Expr*&, swift::DeclContext*, swift::TypeLoc, swift::ContextualTypePurpose, swift::OptionSet<swift::TypeCheckExprFlags, unsigned int>, swift::ExprTypeCheckListener*) + 769
38 swift 0x0000000000f08646 swift::TypeChecker::typeCheckTopLevelCodeDecl(swift::TopLevelCodeDecl*) + 134
39 swift 0x0000000000ec480d swift::performTypeChecking(swift::SourceFile&, swift::TopLevelContext&, swift::OptionSet<swift::TypeCheckingFlags, unsigned int>, unsigned int, unsigned int) + 1133
40 swift 0x0000000000c58ed9 swift::CompilerInstance::performSema() + 3289
42 swift 0x00000000007d739f swift::performFrontend(llvm::ArrayRef<char const*>, char const*, void*, swift::FrontendObserver*) + 2863
43 swift 0x00000000007a33b8 main + 2872
Stack dump:
0. Program arguments: /path/to/swift/bin/swift -frontend -c -primary-file validation-test/compiler_crashers/28306-swift-lookupvisibledecls.swift -target x86_64-unknown-linux-gnu -disable-objc-interop -module-name main -o /tmp/28306-swift-lookupvisibledecls-4e975d.o
1. While type-checking expression at [validation-test/compiler_crashers/28306-swift-lookupvisibledecls.swift:10:1 - line:12:17] RangeText="{
2. While type-checking declaration 0x5b54828 at validation-test/compiler_crashers/28306-swift-lookupvisibledecls.swift:11:1
3. While resolving type A.a at [validation-test/compiler_crashers/28306-swift-lookupvisibledecls.swift:11:5 - line:11:7] RangeText="A.a"
4. While type-checking expression at [validation-test/compiler_crashers/28306-swift-lookupvisibledecls.swift:12:17 - line:12:17] RangeText="T"
<unknown>:0: error: unable to execute command: Aborted
<unknown>:0: error: compile command failed due to signal (use -v to see invocation)
```
|
||
|
|
b16da43522 |
[swiftc] Add test case for crash triggered in swift::TypeChecker::checkGenericParamList(swift::ArchetypeBuilder*, swift::GenericParamList*, swift::GenericSignature*, bool, swift::GenericTypeResolver*)
Stack trace: ``` 4 swift 0x0000000000ed9afd swift::TypeChecker::checkGenericParamList(swift::ArchetypeBuilder*, swift::GenericParamList*, swift::GenericSignature*, bool, swift::GenericTypeResolver*) + 93 6 swift 0x0000000000eda21e swift::TypeChecker::validateGenericFuncSignature(swift::AbstractFunctionDecl*) + 94 9 swift 0x0000000000e9c901 swift::TypeChecker::validateDecl(swift::ValueDecl*, bool) + 1089 10 swift 0x00000000010f57bc swift::DeclContext::lookupQualified(swift::Type, swift::DeclName, swift::NLOptions, swift::LazyResolver*, llvm::SmallVectorImpl<swift::ValueDecl*>&) const + 2652 11 swift 0x00000000010f4055 swift::UnqualifiedLookup::UnqualifiedLookup(swift::DeclName, swift::DeclContext*, swift::LazyResolver*, bool, swift::SourceLoc, bool, bool) + 2469 12 swift 0x0000000000edd37b swift::TypeChecker::lookupUnqualified(swift::DeclContext*, swift::DeclName, swift::SourceLoc, swift::OptionSet<swift::NameLookupFlags, unsigned int>) + 187 15 swift 0x0000000000f0e50e swift::TypeChecker::resolveIdentifierType(swift::DeclContext*, swift::IdentTypeRepr*, swift::OptionSet<swift::TypeResolutionFlags, unsigned int>, bool, swift::GenericTypeResolver*, llvm::function_ref<bool (swift::TypeCheckRequest)>*) + 158 17 swift 0x0000000000f0f514 swift::TypeChecker::resolveType(swift::TypeRepr*, swift::DeclContext*, swift::OptionSet<swift::TypeResolutionFlags, unsigned int>, swift::GenericTypeResolver*, llvm::function_ref<bool (swift::TypeCheckRequest)>*) + 164 18 swift 0x0000000000f0e400 swift::TypeChecker::validateType(swift::TypeLoc&, swift::DeclContext*, swift::OptionSet<swift::TypeResolutionFlags, unsigned int>, swift::GenericTypeResolver*, llvm::function_ref<bool (swift::TypeCheckRequest)>*) + 192 19 swift 0x0000000000ee1167 swift::TypeChecker::typeCheckPattern(swift::Pattern*, swift::DeclContext*, swift::OptionSet<swift::TypeResolutionFlags, unsigned int>, swift::GenericTypeResolver*) + 967 24 swift 0x0000000000ea1e46 swift::TypeChecker::typeCheckDecl(swift::Decl*, bool) + 150 25 swift 0x0000000000ec47a2 swift::performTypeChecking(swift::SourceFile&, swift::TopLevelContext&, swift::OptionSet<swift::TypeCheckingFlags, unsigned int>, unsigned int, unsigned int) + 1026 26 swift 0x0000000000c58ed9 swift::CompilerInstance::performSema() + 3289 28 swift 0x00000000007d739f swift::performFrontend(llvm::ArrayRef<char const*>, char const*, void*, swift::FrontendObserver*) + 2863 29 swift 0x00000000007a33b8 main + 2872 Stack dump: 0. Program arguments: /path/to/swift/bin/swift -frontend -c -primary-file validation-test/compiler_crashers/28305-swift-typechecker-checkgenericparamlist.swift -target x86_64-unknown-linux-gnu -disable-objc-interop -module-name main -o /tmp/28305-swift-typechecker-checkgenericparamlist-6620b8.o 1. While type-checking 'b' at validation-test/compiler_crashers/28305-swift-typechecker-checkgenericparamlist.swift:9:1 2. While resolving type e at [validation-test/compiler_crashers/28305-swift-typechecker-checkgenericparamlist.swift:9:16 - line:9:16] RangeText="e" 3. While type-checking 'e' at validation-test/compiler_crashers/28305-swift-typechecker-checkgenericparamlist.swift:9:19 <unknown>:0: error: unable to execute command: Segmentation fault <unknown>:0: error: compile command failed due to signal (use -v to see invocation) ``` |
||
|
|
0ae5f9ebd5 |
[swiftc] Add test case for crash triggered in swift::TypeChecker::checkGenericParamList(swift::ArchetypeBuilder*, swift::GenericParamList*, swift::GenericSignature*, bool, swift::GenericTypeResolver*)
Stack trace:
```
4 swift 0x0000000000ed76ca swift::TypeChecker::checkGenericParamList(swift::ArchetypeBuilder*, swift::GenericParamList*, swift::GenericSignature*, bool, swift::GenericTypeResolver*) + 74
5 swift 0x0000000000ed8ef7 swift::TypeChecker::validateGenericSignature(swift::GenericParamList*, swift::DeclContext*, swift::GenericSignature*, std::function<bool (swift::ArchetypeBuilder&)>, bool&) + 135
6 swift 0x0000000000ed9296 swift::TypeChecker::validateGenericTypeSignature(swift::GenericTypeDecl*) + 102
7 swift 0x0000000000e9ad4f swift::TypeChecker::validateDecl(swift::ValueDecl*, bool) + 367
10 swift 0x0000000000ea0566 swift::TypeChecker::typeCheckDecl(swift::Decl*, bool) + 150
13 swift 0x0000000000f060c4 swift::TypeChecker::typeCheckClosureBody(swift::ClosureExpr*) + 244
14 swift 0x0000000000f3094c swift::constraints::ConstraintSystem::applySolution(swift::constraints::Solution&, swift::Expr*, swift::Type, bool, bool, bool) + 876
15 swift 0x0000000000e8e211 swift::TypeChecker::typeCheckExpression(swift::Expr*&, swift::DeclContext*, swift::TypeLoc, swift::ContextualTypePurpose, swift::OptionSet<swift::TypeCheckExprFlags, unsigned int>, swift::ExprTypeCheckListener*) + 769
16 swift 0x0000000000e8f2c7 swift::TypeChecker::typeCheckBinding(swift::Pattern*&, swift::Expr*&, swift::DeclContext*) + 343
17 swift 0x0000000000e8f4db swift::TypeChecker::typeCheckPatternBinding(swift::PatternBindingDecl*, unsigned int) + 267
22 swift 0x0000000000ea0566 swift::TypeChecker::typeCheckDecl(swift::Decl*, bool) + 150
23 swift 0x0000000000ec3812 swift::performTypeChecking(swift::SourceFile&, swift::TopLevelContext&, swift::OptionSet<swift::TypeCheckingFlags, unsigned int>, unsigned int, unsigned int) + 994
24 swift 0x0000000000c585e9 swift::CompilerInstance::performSema() + 3289
26 swift 0x00000000007d6f4f swift::performFrontend(llvm::ArrayRef<char const*>, char const*, void*, swift::FrontendObserver*) + 2863
27 swift 0x00000000007a2f58 main + 2872
Stack dump:
0. Program arguments: /path/to/swift/bin/swift -frontend -c -primary-file validation-test/compiler_crashers/28304-swift-typechecker-checkgenericparamlist.swift -target x86_64-unknown-linux-gnu -disable-objc-interop -module-name main -o /tmp/28304-swift-typechecker-checkgenericparamlist-450da6.o
1. While type-checking 'a' at validation-test/compiler_crashers/28304-swift-typechecker-checkgenericparamlist.swift:9:1
2. While type-checking expression at [validation-test/compiler_crashers/28304-swift-typechecker-checkgenericparamlist.swift:9:14 - line:9:32] RangeText="{struct A where h:b"
3. While type-checking 'A' at validation-test/compiler_crashers/28304-swift-typechecker-checkgenericparamlist.swift:9:15
<unknown>:0: error: unable to execute command: Segmentation fault
<unknown>:0: error: compile command failed due to signal (use -v to see invocation)
```
|
||
|
|
6dd62d2842 |
[swiftc] Add test case for crash triggered in swift::TypeChecker::checkGenericParamList(swift::ArchetypeBuilder*, swift::GenericParamList*, swift::GenericSignature*, bool, swift::GenericTypeResolver*)
Stack trace:
```
4 swift 0x0000000000ed76dd swift::TypeChecker::checkGenericParamList(swift::ArchetypeBuilder*, swift::GenericParamList*, swift::GenericSignature*, bool, swift::GenericTypeResolver*) + 93
5 swift 0x0000000000ed8ef7 swift::TypeChecker::validateGenericSignature(swift::GenericParamList*, swift::DeclContext*, swift::GenericSignature*, std::function<bool (swift::ArchetypeBuilder&)>, bool&) + 135
6 swift 0x0000000000ed9296 swift::TypeChecker::validateGenericTypeSignature(swift::GenericTypeDecl*) + 102
7 swift 0x0000000000e9b20f swift::TypeChecker::validateDecl(swift::ValueDecl*, bool) + 1583
11 swift 0x0000000000f0b99e swift::TypeChecker::resolveIdentifierType(swift::DeclContext*, swift::IdentTypeRepr*, swift::OptionSet<swift::TypeResolutionFlags, unsigned int>, bool, swift::GenericTypeResolver*, llvm::function_ref<bool (swift::TypeCheckRequest)>*) + 158
13 swift 0x0000000000f0c9a4 swift::TypeChecker::resolveType(swift::TypeRepr*, swift::DeclContext*, swift::OptionSet<swift::TypeResolutionFlags, unsigned int>, swift::GenericTypeResolver*, llvm::function_ref<bool (swift::TypeCheckRequest)>*) + 164
14 swift 0x0000000000f0b890 swift::TypeChecker::validateType(swift::TypeLoc&, swift::DeclContext*, swift::OptionSet<swift::TypeResolutionFlags, unsigned int>, swift::GenericTypeResolver*, llvm::function_ref<bool (swift::TypeCheckRequest)>*) + 192
15 swift 0x0000000000eded47 swift::TypeChecker::typeCheckPattern(swift::Pattern*, swift::DeclContext*, swift::OptionSet<swift::TypeResolutionFlags, unsigned int>, swift::GenericTypeResolver*) + 967
17 swift 0x0000000000e9bc19 swift::TypeChecker::validateDecl(swift::ValueDecl*, bool) + 4153
18 swift 0x0000000000f1d49d swift::createImplicitConstructor(swift::TypeChecker&, swift::NominalTypeDecl*, swift::ImplicitConstructorKind) + 413
19 swift 0x0000000000ea6176 swift::TypeChecker::addImplicitConstructors(swift::NominalTypeDecl*) + 1526
22 swift 0x0000000000ea0566 swift::TypeChecker::typeCheckDecl(swift::Decl*, bool) + 150
25 swift 0x0000000000f060c4 swift::TypeChecker::typeCheckClosureBody(swift::ClosureExpr*) + 244
26 swift 0x0000000000f3094c swift::constraints::ConstraintSystem::applySolution(swift::constraints::Solution&, swift::Expr*, swift::Type, bool, bool, bool) + 876
27 swift 0x0000000000e8e211 swift::TypeChecker::typeCheckExpression(swift::Expr*&, swift::DeclContext*, swift::TypeLoc, swift::ContextualTypePurpose, swift::OptionSet<swift::TypeCheckExprFlags, unsigned int>, swift::ExprTypeCheckListener*) + 769
29 swift 0x0000000000f06206 swift::TypeChecker::typeCheckTopLevelCodeDecl(swift::TopLevelCodeDecl*) + 134
30 swift 0x0000000000ec387d swift::performTypeChecking(swift::SourceFile&, swift::TopLevelContext&, swift::OptionSet<swift::TypeCheckingFlags, unsigned int>, unsigned int, unsigned int) + 1101
31 swift 0x0000000000c585e9 swift::CompilerInstance::performSema() + 3289
33 swift 0x00000000007d6f4f swift::performFrontend(llvm::ArrayRef<char const*>, char const*, void*, swift::FrontendObserver*) + 2863
34 swift 0x00000000007a2f58 main + 2872
Stack dump:
0. Program arguments: /path/to/swift/bin/swift -frontend -c -primary-file validation-test/compiler_crashers/28303-swift-typechecker-checkgenericparamlist.swift -target x86_64-unknown-linux-gnu -disable-objc-interop -module-name main -o /tmp/28303-swift-typechecker-checkgenericparamlist-4befae.o
1. While type-checking expression at [validation-test/compiler_crashers/28303-swift-typechecker-checkgenericparamlist.swift:9:1 - line:9:41] RangeText="{struct T{let t:e}typealias e:T where h:a"
2. While type-checking 'T' at validation-test/compiler_crashers/28303-swift-typechecker-checkgenericparamlist.swift:9:2
3. While resolving type e at [validation-test/compiler_crashers/28303-swift-typechecker-checkgenericparamlist.swift:9:17 - line:9:17] RangeText="e"
<unknown>:0: error: unable to execute command: Segmentation fault
<unknown>:0: error: compile command failed due to signal (use -v to see invocation)
```
|
||
|
|
85fc78fd59 | Merge pull request #2810 from practicalswift/swiftc-28302-swift-paramdecl-createunboundself | ||
|
|
e484845613 | Merge pull request #2803 from gregomni/compile-flag | ||
|
|
59e247c38a | Merge pull request #2637 from JaSpa/inheritance-clause-diags | ||
|
|
2f9ac3444e |
Disable typealiases in protocols and add frontend flag to re-enable.
Goes back to Swift 2.2 behavior of treating the 'typealias' keyword inside a protocol as a deprecated form of an associatedtype. To get the newer (but still partly buggy) behavior of treating it as an actual typealias, add "-Xfrontend -enable-protocol-typealiases" to the compile invocation. 'decl/typealias/typealias.swift' now uses this flag to continue testing the enabled behavior. |
||
|
|
84a77b8f19 |
[swiftc] Add test case for crash triggered in swift::ParamDecl::createUnboundSelf(swift::SourceLoc, swift::DeclContext*, bool, bool)
Stack trace: ``` swift: /path/to/llvm/include/llvm/ADT/ArrayRef.h:265: T &llvm::MutableArrayRef<swift::GenericTypeParamDecl *>::front() const [T = swift::GenericTypeParamDecl *]: Assertion `!this->empty()' failed. 9 swift 0x00000000010b835b swift::ParamDecl::createUnboundSelf(swift::SourceLoc, swift::DeclContext*, bool, bool) + 75 10 swift 0x00000000010f6ff3 swift::ParameterList::createUnboundSelf(swift::SourceLoc, swift::DeclContext*, bool, bool) + 19 11 swift 0x0000000000e606b6 swift::Parser::parseDeclFunc(swift::SourceLoc, swift::StaticSpellingKind, swift::OptionSet<swift::Parser::ParseDeclFlags, unsigned int>, swift::DeclAttributes&) + 3798 12 swift 0x0000000000e562e0 swift::Parser::parseDecl(swift::OptionSet<swift::Parser::ParseDeclFlags, unsigned int>, llvm::function_ref<void (swift::Decl*)>) + 3760 14 swift 0x0000000000e0a4a9 swift::Parser::parseList(swift::tok, swift::SourceLoc, swift::SourceLoc&, swift::tok, bool, bool, swift::Diag<>, std::function<swift::ParserStatus ()>) + 377 15 swift 0x0000000000e5e188 swift::Parser::parseDeclProtocol(swift::OptionSet<swift::Parser::ParseDeclFlags, unsigned int>, swift::DeclAttributes&) + 1656 16 swift 0x0000000000e56373 swift::Parser::parseDecl(swift::OptionSet<swift::Parser::ParseDeclFlags, unsigned int>, llvm::function_ref<void (swift::Decl*)>) + 3907 18 swift 0x0000000000e0a4a9 swift::Parser::parseList(swift::tok, swift::SourceLoc, swift::SourceLoc&, swift::tok, bool, bool, swift::Diag<>, std::function<swift::ParserStatus ()>) + 377 19 swift 0x0000000000e5c458 swift::Parser::parseDeclStruct(swift::OptionSet<swift::Parser::ParseDeclFlags, unsigned int>, swift::DeclAttributes&) + 1848 20 swift 0x0000000000e5638c swift::Parser::parseDecl(swift::OptionSet<swift::Parser::ParseDeclFlags, unsigned int>, llvm::function_ref<void (swift::Decl*)>) + 3932 21 swift 0x0000000000e386b2 swift::Parser::parseBraceItems(llvm::SmallVectorImpl<swift::ASTNode>&, swift::BraceItemListKind, swift::BraceItemListKind) + 850 22 swift 0x0000000000e4a8ac swift::Parser::parseTopLevel() + 156 23 swift 0x0000000000e06920 swift::parseIntoSourceFile(swift::SourceFile&, unsigned int, bool*, swift::SILParserState*, swift::PersistentParserState*, swift::DelayedParsingCallbacks*) + 208 24 swift 0x0000000000c585c6 swift::CompilerInstance::performSema() + 3254 26 swift 0x00000000007d6f4f swift::performFrontend(llvm::ArrayRef<char const*>, char const*, void*, swift::FrontendObserver*) + 2863 27 swift 0x00000000007a2f58 main + 2872 Stack dump: 0. Program arguments: /path/to/swift/bin/swift -frontend -c -primary-file validation-test/compiler_crashers/28302-swift-paramdecl-createunboundself.swift -target x86_64-unknown-linux-gnu -disable-objc-interop -module-name main -o /tmp/28302-swift-paramdecl-createunboundself-53086d.o 1. With parser at source location: validation-test/compiler_crashers/28302-swift-paramdecl-createunboundself.swift:11:1 <unknown>:0: error: unable to execute command: Aborted <unknown>:0: error: compile command failed due to signal (use -v to see invocation) ``` |
||
|
|
60e7116f47 |
[swiftc] Add test case for crash triggered in swift::constraints::ConstraintSystem::simplifyConstructionConstraint(swift::Type, swift::FunctionType*, unsigned int, swift::constraints::ConstraintLocator*)
Stack trace:
```
6 swift 0x000000000329039d llvm::llvm_unreachable_internal(char const*, char const*, unsigned int) + 461
7 swift 0x0000000000f8d857 swift::constraints::ConstraintSystem::simplifyConstructionConstraint(swift::Type, swift::FunctionType*, unsigned int, swift::constraints::ConstraintLocator*) + 1303
8 swift 0x0000000000f91a05 swift::constraints::ConstraintSystem::simplifyApplicableFnConstraint(swift::constraints::Constraint const&) + 901
9 swift 0x0000000000f920a6 swift::constraints::ConstraintSystem::simplifyConstraint(swift::constraints::Constraint const&) + 854
10 swift 0x0000000000f26937 swift::constraints::ConstraintSystem::addConstraint(swift::constraints::Constraint*, bool, bool) + 23
13 swift 0x000000000104e7f5 swift::Expr::walk(swift::ASTWalker&) + 69
14 swift 0x0000000000f6e158 swift::constraints::ConstraintSystem::generateConstraints(swift::Expr*) + 200
15 swift 0x0000000000e87835 swift::TypeChecker::solveForExpression(swift::Expr*&, swift::DeclContext*, swift::Type, swift::FreeTypeVariableBinding, swift::ExprTypeCheckListener*, swift::constraints::ConstraintSystem&, llvm::SmallVectorImpl<swift::constraints::Solution>&, swift::OptionSet<swift::TypeCheckExprFlags, unsigned int>) + 245
16 swift 0x0000000000e8e172 swift::TypeChecker::typeCheckExpression(swift::Expr*&, swift::DeclContext*, swift::TypeLoc, swift::ContextualTypePurpose, swift::OptionSet<swift::TypeCheckExprFlags, unsigned int>, swift::ExprTypeCheckListener*) + 610
17 swift 0x0000000000e8f2c7 swift::TypeChecker::typeCheckBinding(swift::Pattern*&, swift::Expr*&, swift::DeclContext*) + 343
18 swift 0x0000000000e8f4db swift::TypeChecker::typeCheckPatternBinding(swift::PatternBindingDecl*, unsigned int) + 267
23 swift 0x0000000000ea0566 swift::TypeChecker::typeCheckDecl(swift::Decl*, bool) + 150
24 swift 0x0000000000ec3812 swift::performTypeChecking(swift::SourceFile&, swift::TopLevelContext&, swift::OptionSet<swift::TypeCheckingFlags, unsigned int>, unsigned int, unsigned int) + 994
25 swift 0x0000000000c585e9 swift::CompilerInstance::performSema() + 3289
27 swift 0x00000000007d6f4f swift::performFrontend(llvm::ArrayRef<char const*>, char const*, void*, swift::FrontendObserver*) + 2863
28 swift 0x00000000007a2f58 main + 2872
Stack dump:
0. Program arguments: /path/to/swift/bin/swift -frontend -c -primary-file validation-test/compiler_crashers/28301-swift-constraints-constraintsystem-simplifyconstructionconstraint.swift -target x86_64-unknown-linux-gnu -disable-objc-interop -module-name main -o /tmp/28301-swift-constraints-constraintsystem-simplifyconstructionconstraint-0fec68.o
1. While type-checking 'n' at validation-test/compiler_crashers/28301-swift-constraints-constraintsystem-simplifyconstructionconstraint.swift:9:1
2. While type-checking expression at [validation-test/compiler_crashers/28301-swift-constraints-constraintsystem-simplifyconstructionconstraint.swift:9:48 - line:9:49] RangeText="d{"
<unknown>:0: error: unable to execute command: Aborted
<unknown>:0: error: compile command failed due to signal (use -v to see invocation)
```
|
||
|
|
da780ce27e |
[swiftc] Add test case for crash triggered in swift::Type::transform(llvm::function_ref<swift::Type (swift::Type)>) const
Stack trace:
```
swift: /path/to/llvm/include/llvm/Support/Casting.h:95: static bool llvm::isa_impl_cl<swift::SILFunctionType, const swift::TypeBase *>::doit(const From *) [To = swift::SILFunctionType, From = const swift::TypeBase *]: Assertion `Val && "isa<> used on a null pointer"' failed.
9 swift 0x000000000110ad94 swift::Type::transform(llvm::function_ref<swift::Type (swift::Type)>) const + 36
10 swift 0x000000000110cec8 swift::TypeBase::getTypeOfMember(swift::ModuleDecl*, swift::Type, swift::DeclContext const*) + 136
17 swift 0x0000000000ea0566 swift::TypeChecker::typeCheckDecl(swift::Decl*, bool) + 150
20 swift 0x0000000000f060c4 swift::TypeChecker::typeCheckClosureBody(swift::ClosureExpr*) + 244
21 swift 0x0000000000f3094c swift::constraints::ConstraintSystem::applySolution(swift::constraints::Solution&, swift::Expr*, swift::Type, bool, bool, bool) + 876
22 swift 0x0000000000e8e211 swift::TypeChecker::typeCheckExpression(swift::Expr*&, swift::DeclContext*, swift::TypeLoc, swift::ContextualTypePurpose, swift::OptionSet<swift::TypeCheckExprFlags, unsigned int>, swift::ExprTypeCheckListener*) + 769
23 swift 0x0000000000e8f2c7 swift::TypeChecker::typeCheckBinding(swift::Pattern*&, swift::Expr*&, swift::DeclContext*) + 343
24 swift 0x0000000000e8f4db swift::TypeChecker::typeCheckPatternBinding(swift::PatternBindingDecl*, unsigned int) + 267
26 swift 0x0000000000e9bc19 swift::TypeChecker::validateDecl(swift::ValueDecl*, bool) + 4153
27 swift 0x00000000010f23ac swift::DeclContext::lookupQualified(swift::Type, swift::DeclName, swift::NLOptions, swift::LazyResolver*, llvm::SmallVectorImpl<swift::ValueDecl*>&) const + 2652
28 swift 0x00000000010f0c45 swift::UnqualifiedLookup::UnqualifiedLookup(swift::DeclName, swift::DeclContext*, swift::LazyResolver*, bool, swift::SourceLoc, bool, bool) + 2469
29 swift 0x0000000000edaf5b swift::TypeChecker::lookupUnqualified(swift::DeclContext*, swift::DeclName, swift::SourceLoc, swift::OptionSet<swift::NameLookupFlags, unsigned int>) + 187
32 swift 0x0000000000f0b99e swift::TypeChecker::resolveIdentifierType(swift::DeclContext*, swift::IdentTypeRepr*, swift::OptionSet<swift::TypeResolutionFlags, unsigned int>, bool, swift::GenericTypeResolver*, llvm::function_ref<bool (swift::TypeCheckRequest)>*) + 158
34 swift 0x0000000000f0c9a4 swift::TypeChecker::resolveType(swift::TypeRepr*, swift::DeclContext*, swift::OptionSet<swift::TypeResolutionFlags, unsigned int>, swift::GenericTypeResolver*, llvm::function_ref<bool (swift::TypeCheckRequest)>*) + 164
35 swift 0x0000000000f0b890 swift::TypeChecker::validateType(swift::TypeLoc&, swift::DeclContext*, swift::OptionSet<swift::TypeResolutionFlags, unsigned int>, swift::GenericTypeResolver*, llvm::function_ref<bool (swift::TypeCheckRequest)>*) + 192
37 swift 0x0000000000ed7dfe swift::TypeChecker::validateGenericFuncSignature(swift::AbstractFunctionDecl*) + 94
44 swift 0x0000000000ea0566 swift::TypeChecker::typeCheckDecl(swift::Decl*, bool) + 150
45 swift 0x0000000000ec3812 swift::performTypeChecking(swift::SourceFile&, swift::TopLevelContext&, swift::OptionSet<swift::TypeCheckingFlags, unsigned int>, unsigned int, unsigned int) + 994
46 swift 0x0000000000c585e9 swift::CompilerInstance::performSema() + 3289
48 swift 0x00000000007d6f4f swift::performFrontend(llvm::ArrayRef<char const*>, char const*, void*, swift::FrontendObserver*) + 2863
49 swift 0x00000000007a2f58 main + 2872
Stack dump:
0. Program arguments: /path/to/swift/bin/swift -frontend -c -primary-file validation-test/compiler_crashers/28300-swift-type-transform.swift -target x86_64-unknown-linux-gnu -disable-objc-interop -module-name main -o /tmp/28300-swift-type-transform-f3fdad.o
1. While type-checking 'S' at validation-test/compiler_crashers/28300-swift-type-transform.swift:10:1
2. While resolving type d at [validation-test/compiler_crashers/28300-swift-type-transform.swift:12:8 - line:12:8] RangeText="d"
3. While type-checking expression at [validation-test/compiler_crashers/28300-swift-type-transform.swift:13:7 - line:15:6] RangeText="{
4. While type-checking 'e' at validation-test/compiler_crashers/28300-swift-type-transform.swift:14:11
<unknown>:0: error: unable to execute command: Aborted
<unknown>:0: error: compile command failed due to signal (use -v to see invocation)
```
|
||
|
|
99365add51 |
Merge pull request #2776 from practicalswift/swiftc-28299-swift-lookupvisibledecls
[swiftc] Add test case for crash triggered in swift::lookupVisibleDecls(…) |
||
|
|
dbbd153759 | My recent patch "broke" these tests, but allowing the syntax in them to trigger existing generics bugs. | ||
|
|
b7fd2d12cd |
[swiftc] Add test case for crash triggered in swift::lookupVisibleDecls(swift::VisibleDeclConsumer&, swift::DeclContext const*, swift::LazyResolver*, bool, swift::SourceLoc)
Stack trace: ``` swift: /path/to/swift/lib/Sema/CSGen.cpp:3315: bool swift::isExtensionApplied(swift::DeclContext &, swift::Type, const swift::ExtensionDecl *): Assertion `GenericParams.size() == GenericArgs.size()' failed. 12 swift 0x00000000010d0c86 swift::lookupVisibleDecls(swift::VisibleDeclConsumer&, swift::DeclContext const*, swift::LazyResolver*, bool, swift::SourceLoc) + 1174 13 swift 0x0000000000edc344 swift::TypeChecker::performTypoCorrection(swift::DeclContext*, swift::DeclRefKind, swift::DeclName, swift::SourceLoc, swift::OptionSet<swift::NameLookupFlags, unsigned int>, swift::LookupResult&, unsigned int) + 260 14 swift 0x0000000000e86f78 swift::TypeChecker::resolveDeclRefExpr(swift::UnresolvedDeclRefExpr*, swift::DeclContext*) + 3864 16 swift 0x000000000104e623 swift::Expr::walk(swift::ASTWalker&) + 19 17 swift 0x0000000000e87797 swift::TypeChecker::solveForExpression(swift::Expr*&, swift::DeclContext*, swift::Type, swift::FreeTypeVariableBinding, swift::ExprTypeCheckListener*, swift::constraints::ConstraintSystem&, llvm::SmallVectorImpl<swift::constraints::Solution>&, swift::OptionSet<swift::TypeCheckExprFlags, unsigned int>) + 119 18 swift 0x0000000000e8e152 swift::TypeChecker::typeCheckExpression(swift::Expr*&, swift::DeclContext*, swift::TypeLoc, swift::ContextualTypePurpose, swift::OptionSet<swift::TypeCheckExprFlags, unsigned int>, swift::ExprTypeCheckListener*) + 610 19 swift 0x0000000000e8f2a7 swift::TypeChecker::typeCheckBinding(swift::Pattern*&, swift::Expr*&, swift::DeclContext*) + 343 20 swift 0x0000000000e8f4bb swift::TypeChecker::typeCheckPatternBinding(swift::PatternBindingDecl*, unsigned int) + 267 27 swift 0x0000000000ea0546 swift::TypeChecker::typeCheckDecl(swift::Decl*, bool) + 150 28 swift 0x0000000000ec37f2 swift::performTypeChecking(swift::SourceFile&, swift::TopLevelContext&, swift::OptionSet<swift::TypeCheckingFlags, unsigned int>, unsigned int, unsigned int) + 994 29 swift 0x0000000000c58c79 swift::CompilerInstance::performSema() + 3289 31 swift 0x00000000007d6eef swift::performFrontend(llvm::ArrayRef<char const*>, char const*, void*, swift::FrontendObserver*) + 2863 32 swift 0x00000000007a2ef8 main + 2872 Stack dump: 0. Program arguments: /path/to/swift/bin/swift -frontend -c -primary-file validation-test/compiler_crashers/28299-swift-lookupvisibledecls.swift -target x86_64-unknown-linux-gnu -disable-objc-interop -module-name main -o /tmp/28299-swift-lookupvisibledecls-cad1b5.o 1. While type-checking 'd' at validation-test/compiler_crashers/28299-swift-lookupvisibledecls.swift:12:1 2. While type-checking expression at [validation-test/compiler_crashers/28299-swift-lookupvisibledecls.swift:12:28 - line:12:28] RangeText="a" <unknown>:0: error: unable to execute command: Aborted <unknown>:0: error: compile command failed due to signal (use -v to see invocation) ``` |