Commit Graph

1575 Commits

Author SHA1 Message Date
practicalswift
e6813aa825 [crashers] Update credits. 2016-03-14 20:53:03 +01:00
Chris Lattner
e1ad6d80ee fix 28270-swift-constraints-constraintsystem-diagnosefailureforexpr.swift 2016-03-14 11:56:32 -07:00
practicalswift
b27f54829a [swiftc] Add test case for crash triggered in swift::constraints::ConstraintSystem::diagnoseFailureForExpr(swift::Expr*)
Stack trace:

```
6  swift           0x000000000310acdd llvm::llvm_unreachable_internal(char const*, char const*, unsigned int) + 461
12 swift           0x0000000000eec759 swift::constraints::ConstraintSystem::diagnoseFailureForExpr(swift::Expr*) + 105
13 swift           0x0000000000ef1230 swift::constraints::ConstraintSystem::salvage(llvm::SmallVectorImpl<swift::constraints::Solution>&, swift::Expr*) + 4064
14 swift           0x0000000000e2efb3 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>) + 787
15 swift           0x0000000000e35460 swift::TypeChecker::typeCheckExpression(swift::Expr*&, swift::DeclContext*, swift::Type, swift::ContextualTypePurpose, swift::OptionSet<swift::TypeCheckExprFlags, unsigned int>, swift::ExprTypeCheckListener*) + 576
20 swift           0x0000000000eec759 swift::constraints::ConstraintSystem::diagnoseFailureForExpr(swift::Expr*) + 105
21 swift           0x0000000000ef1230 swift::constraints::ConstraintSystem::salvage(llvm::SmallVectorImpl<swift::constraints::Solution>&, swift::Expr*) + 4064
22 swift           0x0000000000e2efb3 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>) + 787
23 swift           0x0000000000e35460 swift::TypeChecker::typeCheckExpression(swift::Expr*&, swift::DeclContext*, swift::Type, swift::ContextualTypePurpose, swift::OptionSet<swift::TypeCheckExprFlags, unsigned int>, swift::ExprTypeCheckListener*) + 576
28 swift           0x0000000000eec759 swift::constraints::ConstraintSystem::diagnoseFailureForExpr(swift::Expr*) + 105
29 swift           0x0000000000ef1230 swift::constraints::ConstraintSystem::salvage(llvm::SmallVectorImpl<swift::constraints::Solution>&, swift::Expr*) + 4064
30 swift           0x0000000000e2efb3 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>) + 787
31 swift           0x0000000000e35460 swift::TypeChecker::typeCheckExpression(swift::Expr*&, swift::DeclContext*, swift::Type, swift::ContextualTypePurpose, swift::OptionSet<swift::TypeCheckExprFlags, unsigned int>, swift::ExprTypeCheckListener*) + 576
33 swift           0x0000000000ea6f56 swift::TypeChecker::typeCheckTopLevelCodeDecl(swift::TopLevelCodeDecl*) + 134
34 swift           0x0000000000e6a9dd swift::performTypeChecking(swift::SourceFile&, swift::TopLevelContext&, swift::OptionSet<swift::TypeCheckingFlags, unsigned int>, unsigned int) + 1149
35 swift           0x0000000000cbcf5f swift::CompilerInstance::performSema() + 3087
37 swift           0x000000000078b6ff frontend_main(llvm::ArrayRef<char const*>, char const*, void*) + 2495
38 swift           0x00000000007861c5 main + 2837
Stack dump:
0.	Program arguments: /path/to/swift/bin/swift -frontend -c -primary-file validation-test/compiler_crashers/28270-swift-constraints-constraintsystem-diagnosefailureforexpr.swift -target x86_64-unknown-linux-gnu -disable-objc-interop -module-name main -o /tmp/28270-swift-constraints-constraintsystem-diagnosefailureforexpr-edc728.o
1.	While type-checking expression at [validation-test/compiler_crashers/28270-swift-constraints-constraintsystem-diagnosefailureforexpr.swift:5:1 - line:5:6] RangeText="!(0^_{"
2.	While type-checking expression at [validation-test/compiler_crashers/28270-swift-constraints-constraintsystem-diagnosefailureforexpr.swift:5:3 - line:5:6] RangeText="0^_{"
3.	While type-checking expression at [validation-test/compiler_crashers/28270-swift-constraints-constraintsystem-diagnosefailureforexpr.swift:5:5 - line:5:6] RangeText="_{"
<unknown>:0: error: unable to execute command: Aborted
<unknown>:0: error: compile command failed due to signal (use -v to see invocation)
```
2016-03-14 11:29:07 +01:00
practicalswift
58dd619504 Merge pull request #1669 from practicalswift/swiftc-28269-swift-expr-walk
[swiftc] Add test case for crash triggered in swift::Expr::walk(…)
2016-03-14 09:15:11 +01:00
gregomni
03f5c713fd My last commit a11e911 accidentally fixed this recently added crash. 2016-03-13 22:54:08 -07:00
practicalswift
feaa3a7ad0 [swiftc] Add test case for crash triggered in swift::Expr::walk(swift::ASTWalker&)
Stack trace:

```
swift: /path/to/swift/lib/Sema/CSApply.cpp:147: swift::Type swift::constraints::Solution::computeSubstitutions(swift::Type, swift::DeclContext *, swift::Type, swift::constraints::ConstraintLocator *, SmallVectorImpl<swift::Substitution> &) const: Assertion `(conforms || firstArchetype->getIsRecursive() || isOpenedAnyObject(replacement) || replacement->is<GenericTypeParamType>()) && "Constraint system missed a conformance?"' failed.
12 swift           0x0000000000fde105 swift::Expr::walk(swift::ASTWalker&) + 69
13 swift           0x0000000000ed2786 swift::constraints::ConstraintSystem::applySolution(swift::constraints::Solution&, swift::Expr*, swift::Type, bool, bool, bool) + 502
14 swift           0x0000000000e3548a swift::TypeChecker::typeCheckExpression(swift::Expr*&, swift::DeclContext*, swift::Type, swift::ContextualTypePurpose, swift::OptionSet<swift::TypeCheckExprFlags, unsigned int>, swift::ExprTypeCheckListener*) + 746
16 swift           0x0000000000eec723 swift::constraints::ConstraintSystem::diagnoseFailureForExpr(swift::Expr*) + 179
17 swift           0x0000000000ef11b0 swift::constraints::ConstraintSystem::salvage(llvm::SmallVectorImpl<swift::constraints::Solution>&, swift::Expr*) + 4064
18 swift           0x0000000000e2ef33 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>) + 787
19 swift           0x0000000000e353e0 swift::TypeChecker::typeCheckExpression(swift::Expr*&, swift::DeclContext*, swift::Type, swift::ContextualTypePurpose, swift::OptionSet<swift::TypeCheckExprFlags, unsigned int>, swift::ExprTypeCheckListener*) + 576
23 swift           0x0000000000ea5a5a swift::TypeChecker::typeCheckFunctionBodyUntil(swift::FuncDecl*, swift::SourceLoc) + 346
24 swift           0x0000000000ea58be swift::TypeChecker::typeCheckAbstractFunctionBodyUntil(swift::AbstractFunctionDecl*, swift::SourceLoc) + 46
25 swift           0x0000000000ea6458 swift::TypeChecker::typeCheckAbstractFunctionBody(swift::AbstractFunctionDecl*) + 136
27 swift           0x0000000000e6a9f4 swift::performTypeChecking(swift::SourceFile&, swift::TopLevelContext&, swift::OptionSet<swift::TypeCheckingFlags, unsigned int>, unsigned int) + 1300
28 swift           0x0000000000cbcedf swift::CompilerInstance::performSema() + 3087
30 swift           0x000000000078b6ff frontend_main(llvm::ArrayRef<char const*>, char const*, void*) + 2495
31 swift           0x00000000007861c5 main + 2837
Stack dump:
0.	Program arguments: /path/to/swift/bin/swift -frontend -c -primary-file validation-test/compiler_crashers/28269-swift-expr-walk.swift -target x86_64-unknown-linux-gnu -disable-objc-interop -module-name main -o /tmp/28269-swift-expr-walk-5303a6.o
1.	While type-checking getter for t at validation-test/compiler_crashers/28269-swift-expr-walk.swift:10:46
2.	While type-checking expression at [<invalid loc> - <invalid loc>]
3.	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)
```
2016-03-13 22:22:42 +01:00
practicalswift
dace490553 [swiftc] Add test case for crash triggered in swift::Type::transform(std::function<swift::Type (swift::Type)> const&) 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           0x0000000001096f1d swift::Type::transform(std::function<swift::Type (swift::Type)> const&) const + 45
10 swift           0x000000000109156f swift::Type::subst(swift::ModuleDecl*, llvm::DenseMap<swift::TypeBase*, swift::Type, llvm::DenseMapInfo<swift::TypeBase*>, llvm::detail::DenseMapPair<swift::TypeBase*, swift::Type> >&, swift::OptionSet<swift::SubstFlags, unsigned int>) const + 111
13 swift           0x0000000000e8a11e swift::TypeChecker::resolveTypeWitness(swift::NormalProtocolConformance const*, swift::AssociatedTypeDecl*) + 254
14 swift           0x0000000001087d46 swift::NormalProtocolConformance::getTypeWitnessSubstAndDecl(swift::AssociatedTypeDecl*, swift::LazyResolver*) const + 150
15 swift           0x0000000001087c88 swift::ProtocolConformance::getTypeWitnessSubstAndDecl(swift::AssociatedTypeDecl*, swift::LazyResolver*) const + 40
16 swift           0x0000000001088486 swift::ProtocolConformance::getTypeWitness(swift::AssociatedTypeDecl*, swift::LazyResolver*) const + 6
17 swift           0x0000000000e8210f swift::TypeChecker::lookupMemberType(swift::DeclContext*, swift::Type, swift::Identifier, swift::OptionSet<swift::NameLookupFlags, unsigned int>) + 1071
19 swift           0x0000000000eabdee swift::TypeChecker::resolveIdentifierType(swift::DeclContext*, swift::IdentTypeRepr*, swift::OptionSet<swift::TypeResolutionFlags, unsigned int>, bool, swift::GenericTypeResolver*, llvm::function_ref<bool (swift::TypeCheckRequest)>*) + 158
21 swift           0x0000000000eacd04 swift::TypeChecker::resolveType(swift::TypeRepr*, swift::DeclContext*, swift::OptionSet<swift::TypeResolutionFlags, unsigned int>, swift::GenericTypeResolver*, llvm::function_ref<bool (swift::TypeCheckRequest)>*) + 164
22 swift           0x0000000000eabcea swift::TypeChecker::validateType(swift::TypeLoc&, swift::DeclContext*, swift::OptionSet<swift::TypeResolutionFlags, unsigned int>, swift::GenericTypeResolver*, llvm::function_ref<bool (swift::TypeCheckRequest)>*) + 42
27 swift           0x0000000000e47556 swift::TypeChecker::typeCheckDecl(swift::Decl*, bool) + 150
30 swift           0x0000000000ea5a5a swift::TypeChecker::typeCheckFunctionBodyUntil(swift::FuncDecl*, swift::SourceLoc) + 346
31 swift           0x0000000000ea58be swift::TypeChecker::typeCheckAbstractFunctionBodyUntil(swift::AbstractFunctionDecl*, swift::SourceLoc) + 46
32 swift           0x0000000000ea6458 swift::TypeChecker::typeCheckAbstractFunctionBody(swift::AbstractFunctionDecl*) + 136
34 swift           0x0000000000e6a9f4 swift::performTypeChecking(swift::SourceFile&, swift::TopLevelContext&, swift::OptionSet<swift::TypeCheckingFlags, unsigned int>, unsigned int) + 1300
35 swift           0x0000000000cbcedf swift::CompilerInstance::performSema() + 3087
37 swift           0x000000000078b6ff frontend_main(llvm::ArrayRef<char const*>, char const*, void*) + 2495
38 swift           0x00000000007861c5 main + 2837
Stack dump:
0.	Program arguments: /path/to/swift/bin/swift -frontend -c -primary-file validation-test/compiler_crashers/28268-swift-type-transform.swift -target x86_64-unknown-linux-gnu -disable-objc-interop -module-name main -o /tmp/28268-swift-type-transform-b6bd0e.o
1.	While type-checking declaration 0x648dd80 at validation-test/compiler_crashers/28268-swift-type-transform.swift:10:5
2.	While type-checking 'a' at validation-test/compiler_crashers/28268-swift-type-transform.swift:10:6
3.	While resolving type A.e at [validation-test/compiler_crashers/28268-swift-type-transform.swift:11:13 - line:11:15] RangeText="A.e"
<unknown>:0: error: unable to execute command: Aborted
<unknown>:0: error: compile command failed due to signal (use -v to see invocation)
```
2016-03-13 12:44:19 +01:00
practicalswift
a3dfb717ab [swiftc] Add test case for crash triggered in swift::TypeChecker::checkConformance(swift::NormalProtocolConformance*)
Stack trace:

```
swift: /path/to/swift/lib/Sema/CSApply.cpp:147: swift::Type swift::constraints::Solution::computeSubstitutions(swift::Type, swift::DeclContext *, swift::Type, swift::constraints::ConstraintLocator *, SmallVectorImpl<swift::Substitution> &) const: Assertion `(conforms || firstArchetype->getIsRecursive() || isOpenedAnyObject(replacement) || replacement->is<GenericTypeParamType>()) && "Constraint system missed a conformance?"' failed.
13 swift           0x0000000000e89f3d swift::TypeChecker::checkConformance(swift::NormalProtocolConformance*) + 2237
17 swift           0x0000000000e47556 swift::TypeChecker::typeCheckDecl(swift::Decl*, bool) + 150
20 swift           0x0000000000ea6d8a swift::TypeChecker::typeCheckClosureBody(swift::ClosureExpr*) + 218
21 swift           0x0000000000ed28bc swift::constraints::ConstraintSystem::applySolution(swift::constraints::Solution&, swift::Expr*, swift::Type, bool, bool, bool) + 812
22 swift           0x0000000000e3548a swift::TypeChecker::typeCheckExpression(swift::Expr*&, swift::DeclContext*, swift::Type, swift::ContextualTypePurpose, swift::OptionSet<swift::TypeCheckExprFlags, unsigned int>, swift::ExprTypeCheckListener*) + 746
25 swift           0x0000000000ea5ead swift::TypeChecker::typeCheckConstructorBodyUntil(swift::ConstructorDecl*, swift::SourceLoc) + 845
26 swift           0x0000000000ea58b2 swift::TypeChecker::typeCheckAbstractFunctionBodyUntil(swift::AbstractFunctionDecl*, swift::SourceLoc) + 34
27 swift           0x0000000000ea6458 swift::TypeChecker::typeCheckAbstractFunctionBody(swift::AbstractFunctionDecl*) + 136
29 swift           0x0000000000e6a9f4 swift::performTypeChecking(swift::SourceFile&, swift::TopLevelContext&, swift::OptionSet<swift::TypeCheckingFlags, unsigned int>, unsigned int) + 1300
30 swift           0x0000000000cbcedf swift::CompilerInstance::performSema() + 3087
32 swift           0x000000000078b6ff frontend_main(llvm::ArrayRef<char const*>, char const*, void*) + 2495
33 swift           0x00000000007861c5 main + 2837
Stack dump:
0.	Program arguments: /path/to/swift/bin/swift -frontend -c -primary-file validation-test/compiler_crashers/28267-swift-typechecker-checkconformance.swift -target x86_64-unknown-linux-gnu -disable-objc-interop -module-name main -o /tmp/28267-swift-typechecker-checkconformance-1f2757.o
1.	While type-checking 'init' at validation-test/compiler_crashers/28267-swift-typechecker-checkconformance.swift:10:27
2.	While type-checking expression at [validation-test/compiler_crashers/28267-swift-typechecker-checkconformance.swift:10:34 - line:10:44] RangeText="{enum S<h{c"
3.	While type-checking 'S' at validation-test/compiler_crashers/28267-swift-typechecker-checkconformance.swift:10:35
<unknown>:0: error: unable to execute command: Aborted
<unknown>:0: error: compile command failed due to signal (use -v to see invocation)
```
2016-03-13 11:24:57 +01:00
practicalswift
dd94851de7 [swiftc] Add test case for crash triggered in swift::ModuleDecl::lookupPrefixOperator(swift::Identifier, swift::SourceLoc)
Stack trace:

```
6  swift           0x000000000310ab3d llvm::llvm_unreachable_internal(char const*, char const*, unsigned int) + 461
7  swift           0x000000000106f570 swift::ModuleDecl::lookupPrefixOperator(swift::Identifier, swift::SourceLoc) + 0
9  swift           0x0000000000f66048 swift::ArchetypeBuilder::PotentialArchetype::addConformance(swift::ProtocolDecl*, swift::RequirementSource const&, swift::ArchetypeBuilder&) + 296
10 swift           0x0000000000f69a16 swift::ArchetypeBuilder::addConformanceRequirement(swift::ArchetypeBuilder::PotentialArchetype*, swift::ProtocolDecl*, swift::RequirementSource, llvm::SmallPtrSetImpl<swift::ProtocolDecl*>&) + 118
13 swift           0x0000000000f6b9ff swift::ArchetypeBuilder::visitInherited(llvm::ArrayRef<swift::TypeLoc>, llvm::function_ref<bool (swift::Type, swift::SourceLoc)>) + 175
14 swift           0x0000000000f697ea swift::ArchetypeBuilder::addAbstractTypeParamRequirements(swift::AbstractTypeParamDecl*, swift::ArchetypeBuilder::PotentialArchetype*, swift::RequirementSource::Kind, llvm::SmallPtrSetImpl<swift::ProtocolDecl*>&) + 426
15 swift           0x0000000000f69b77 swift::ArchetypeBuilder::addConformanceRequirement(swift::ArchetypeBuilder::PotentialArchetype*, swift::ProtocolDecl*, swift::RequirementSource, llvm::SmallPtrSetImpl<swift::ProtocolDecl*>&) + 471
18 swift           0x0000000000f6b9ff swift::ArchetypeBuilder::visitInherited(llvm::ArrayRef<swift::TypeLoc>, llvm::function_ref<bool (swift::Type, swift::SourceLoc)>) + 175
19 swift           0x0000000000f697ea swift::ArchetypeBuilder::addAbstractTypeParamRequirements(swift::AbstractTypeParamDecl*, swift::ArchetypeBuilder::PotentialArchetype*, swift::RequirementSource::Kind, llvm::SmallPtrSetImpl<swift::ProtocolDecl*>&) + 426
20 swift           0x0000000000f6961c swift::ArchetypeBuilder::addGenericParameterRequirements(swift::GenericTypeParamDecl*) + 172
21 swift           0x0000000000e7d3f7 swift::TypeChecker::checkGenericParamList(swift::ArchetypeBuilder*, swift::GenericParamList*, swift::GenericSignature*, bool, swift::GenericTypeResolver*) + 375
22 swift           0x0000000000e7eb07 swift::TypeChecker::validateGenericSignature(swift::GenericParamList*, swift::DeclContext*, swift::GenericSignature*, std::function<bool (swift::ArchetypeBuilder&)>, bool&) + 135
23 swift           0x0000000000e7eea6 swift::TypeChecker::validateGenericTypeSignature(swift::GenericTypeDecl*) + 102
24 swift           0x0000000000e41f31 swift::TypeChecker::validateDecl(swift::ValueDecl*, bool) + 1601
29 swift           0x0000000000e47556 swift::TypeChecker::typeCheckDecl(swift::Decl*, bool) + 150
30 swift           0x0000000000e6a8e2 swift::performTypeChecking(swift::SourceFile&, swift::TopLevelContext&, swift::OptionSet<swift::TypeCheckingFlags, unsigned int>, unsigned int) + 1026
31 swift           0x0000000000cbcedf swift::CompilerInstance::performSema() + 3087
33 swift           0x000000000078b6ff frontend_main(llvm::ArrayRef<char const*>, char const*, void*) + 2495
34 swift           0x00000000007861c5 main + 2837
Stack dump:
0.	Program arguments: /path/to/swift/bin/swift -frontend -c -primary-file validation-test/compiler_crashers/28266-swift-moduledecl-lookupprefixoperator.swift -target x86_64-unknown-linux-gnu -disable-objc-interop -module-name main -o /tmp/28266-swift-moduledecl-lookupprefixoperator-bacf6e.o
1.	While type-checking 'B' at validation-test/compiler_crashers/28266-swift-moduledecl-lookupprefixoperator.swift:9:1
<unknown>:0: error: unable to execute command: Aborted
<unknown>:0: error: compile command failed due to signal (use -v to see invocation)
```
2016-03-13 10:24:38 +01:00
Dmitri Gribenko
3bf4d15037 Merge pull request #1659 from practicalswift/swiftc-28265-swift-expr-walk
[swiftc] Add test case for crash triggered in swift::Expr::walk(…)
2016-03-12 19:30:12 -08:00
practicalswift
4a0a62ce1f [swiftc] Add test case for crash triggered in swift::Expr::walk(swift::ASTWalker&)
Stack trace:

```
swift: /path/to/swift/lib/Sema/CSApply.cpp:2314: swift::Expr *(anonymous namespace)::ExprRewriter::applyMemberRefExpr(swift::Expr *, swift::Expr *, swift::SourceLoc, swift::DeclNameLoc, bool): Assertion `resultTy->hasUnresolvedType() && "Should have a selected member if we got a type"' failed.
13 swift           0x0000000000fdccbe swift::Expr::walk(swift::ASTWalker&) + 46
14 swift           0x0000000000ed1376 swift::constraints::ConstraintSystem::applySolution(swift::constraints::Solution&, swift::Expr*, swift::Type, bool, bool, bool) + 502
15 swift           0x0000000000e33eca swift::TypeChecker::typeCheckExpression(swift::Expr*&, swift::DeclContext*, swift::Type, swift::ContextualTypePurpose, swift::OptionSet<swift::TypeCheckExprFlags, unsigned int>, swift::ExprTypeCheckListener*) + 746
18 swift           0x0000000000eeb2c9 swift::constraints::ConstraintSystem::diagnoseFailureForExpr(swift::Expr*) + 105
19 swift           0x0000000000eefda0 swift::constraints::ConstraintSystem::salvage(llvm::SmallVectorImpl<swift::constraints::Solution>&, swift::Expr*) + 4064
20 swift           0x0000000000e2d973 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>) + 787
21 swift           0x0000000000e33e20 swift::TypeChecker::typeCheckExpression(swift::Expr*&, swift::DeclContext*, swift::Type, swift::ContextualTypePurpose, swift::OptionSet<swift::TypeCheckExprFlags, unsigned int>, swift::ExprTypeCheckListener*) + 576
22 swift           0x0000000000e35ad1 swift::TypeChecker::typeCheckCondition(swift::Expr*&, swift::DeclContext*) + 145
23 swift           0x0000000000e35c2b swift::TypeChecker::typeCheckStmtCondition(llvm::MutableArrayRef<swift::StmtConditionElement>&, swift::DeclContext*, swift::Diag<>) + 251
27 swift           0x0000000000ea468a swift::TypeChecker::typeCheckFunctionBodyUntil(swift::FuncDecl*, swift::SourceLoc) + 346
28 swift           0x0000000000ea44ee swift::TypeChecker::typeCheckAbstractFunctionBodyUntil(swift::AbstractFunctionDecl*, swift::SourceLoc) + 46
29 swift           0x0000000000ea5088 swift::TypeChecker::typeCheckAbstractFunctionBody(swift::AbstractFunctionDecl*) + 136
31 swift           0x0000000000e69624 swift::performTypeChecking(swift::SourceFile&, swift::TopLevelContext&, swift::OptionSet<swift::TypeCheckingFlags, unsigned int>, unsigned int) + 1300
32 swift           0x0000000000cbc58f swift::CompilerInstance::performSema() + 3087
34 swift           0x000000000078b54f frontend_main(llvm::ArrayRef<char const*>, char const*, void*) + 2495
35 swift           0x0000000000786015 main + 2837
Stack dump:
0.	Program arguments: /path/to/swift/bin/swift -frontend -c -primary-file validation-test/compiler_crashers/28265-swift-expr-walk.swift -target x86_64-unknown-linux-gnu -disable-objc-interop -module-name main -o /tmp/28265-swift-expr-walk-d333bf.o
1.	While type-checking 'a' at validation-test/compiler_crashers/28265-swift-expr-walk.swift:10:9
2.	While type-checking expression at [validation-test/compiler_crashers/28265-swift-expr-walk.swift:10:19 - line:10:29] RangeText="c == .h.c=a"
3.	While type-checking expression at [validation-test/compiler_crashers/28265-swift-expr-walk.swift:10:19 - line:10:27] RangeText="c == .h.c"
<unknown>:0: error: unable to execute command: Aborted
<unknown>:0: error: compile command failed due to signal (use -v to see invocation)
```
2016-03-12 22:15:53 +01:00
Janek Spaderna
8bca045718 [AST] Fail to compute the EnumElementDecl type in case of an ErrorType
If the resulting function type contains an ErrorType, this is an indicator that
something else is wrong. Bail out in this case.
This happened if an enum case was referenced inside the where-clause and treated
as a type.
2016-03-12 11:53:16 +01:00
practicalswift
d43320c01a [swiftc] Add test case for crash triggered in swift::ValueDecl::getInterfaceType() const
Stack trace:

```
4  swift           0x000000000103cc7c swift::ValueDecl::getInterfaceType() const + 12
5  swift           0x000000000103d836 swift::TypeDecl::getDeclaredInterfaceType() const + 6
6  swift           0x0000000000e7b8a1 swift::DependentGenericTypeResolver::resolveTypeOfContext(swift::DeclContext*) + 81
7  swift           0x0000000000ea979f swift::TypeChecker::resolveTypeInContext(swift::TypeDecl*, swift::DeclContext*, swift::OptionSet<swift::TypeResolutionFlags, unsigned int>, bool, swift::GenericTypeResolver*, llvm::function_ref<bool (swift::TypeCheckRequest)>*) + 911
11 swift           0x0000000000eaaa1e 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           0x0000000000eab934 swift::TypeChecker::resolveType(swift::TypeRepr*, swift::DeclContext*, swift::OptionSet<swift::TypeResolutionFlags, unsigned int>, swift::GenericTypeResolver*, llvm::function_ref<bool (swift::TypeCheckRequest)>*) + 164
14 swift           0x0000000000eaa91a swift::TypeChecker::validateType(swift::TypeLoc&, swift::DeclContext*, swift::OptionSet<swift::TypeResolutionFlags, unsigned int>, swift::GenericTypeResolver*, llvm::function_ref<bool (swift::TypeCheckRequest)>*) + 42
15 swift           0x0000000000e7c162 swift::TypeChecker::checkGenericParamList(swift::ArchetypeBuilder*, swift::GenericParamList*, swift::GenericSignature*, bool, swift::GenericTypeResolver*) + 690
16 swift           0x0000000000e7d737 swift::TypeChecker::validateGenericSignature(swift::GenericParamList*, swift::DeclContext*, swift::GenericSignature*, std::function<bool (swift::ArchetypeBuilder&)>, bool&) + 135
17 swift           0x0000000000e7dad6 swift::TypeChecker::validateGenericTypeSignature(swift::GenericTypeDecl*) + 102
18 swift           0x0000000000e40b42 swift::TypeChecker::validateDecl(swift::ValueDecl*, bool) + 1554
23 swift           0x0000000000e46196 swift::TypeChecker::typeCheckDecl(swift::Decl*, bool) + 150
26 swift           0x0000000000ea59ba swift::TypeChecker::typeCheckClosureBody(swift::ClosureExpr*) + 218
27 swift           0x0000000000ed14ac swift::constraints::ConstraintSystem::applySolution(swift::constraints::Solution&, swift::Expr*, swift::Type, bool, bool, bool) + 812
28 swift           0x0000000000e33eca swift::TypeChecker::typeCheckExpression(swift::Expr*&, swift::DeclContext*, swift::Type, swift::ContextualTypePurpose, swift::OptionSet<swift::TypeCheckExprFlags, unsigned int>, swift::ExprTypeCheckListener*) + 746
30 swift           0x0000000000ea5b06 swift::TypeChecker::typeCheckTopLevelCodeDecl(swift::TopLevelCodeDecl*) + 134
31 swift           0x0000000000e6958d swift::performTypeChecking(swift::SourceFile&, swift::TopLevelContext&, swift::OptionSet<swift::TypeCheckingFlags, unsigned int>, unsigned int) + 1149
32 swift           0x0000000000cbc58f swift::CompilerInstance::performSema() + 3087
34 swift           0x000000000078b54f frontend_main(llvm::ArrayRef<char const*>, char const*, void*) + 2495
35 swift           0x0000000000786015 main + 2837
Stack dump:
0.	Program arguments: /path/to/swift/bin/swift -frontend -c -primary-file validation-test/compiler_crashers/28264-swift-valuedecl-getinterfacetype.swift -target x86_64-unknown-linux-gnu -disable-objc-interop -module-name main -o /tmp/28264-swift-valuedecl-getinterfacetype-d01804.o
1.	While type-checking expression at [validation-test/compiler_crashers/28264-swift-valuedecl-getinterfacetype.swift:9:1 - line:9:35] RangeText="{class A{typealias B<T where B:T>:v"
2.	While type-checking 'A' at validation-test/compiler_crashers/28264-swift-valuedecl-getinterfacetype.swift:9:2
3.	While resolving type B at [validation-test/compiler_crashers/28264-swift-valuedecl-getinterfacetype.swift:9:30 - line:9:30] RangeText="B"
<unknown>:0: error: unable to execute command: Segmentation fault
<unknown>:0: error: compile command failed due to signal (use -v to see invocation)
```
2016-03-12 10:32:05 +01:00
Chris Lattner
583ea34d63 Merge pull request #1643 from practicalswift/swiftc-28263-swift-typechecker-validatedecl
[swiftc] Add test case for crash triggered in swift::TypeChecker::validateDecl(…)
2016-03-11 16:57:53 -08:00
Chris Lattner
21e1de1614 Merge pull request #1625 from practicalswift/swiftc-28262-swift-typechecker-applyunboundgenericarguments
[swiftc] Add test case for crash triggered in swift::TypeChecker::applyUnboundGenericArguments(…)
2016-03-11 16:57:32 -08:00
practicalswift
4ad5ed4ada [crashers] License: Apache License v2.0 with Runtime Library Exception 2016-03-11 22:35:33 +01:00
practicalswift
fd215f8d68 [swiftc] Add test case for crash triggered in swift::TypeChecker::applyUnboundGenericArguments(swift::UnboundGenericType*, swift::SourceLoc, swift::DeclContext*, llvm::MutableArrayRef<swift::TypeLoc>, bool, swift::GenericTypeResolver*)
Stack trace:

```
swift: /path/to/swift/include/swift/AST/Decl.h:2439: swift::Type swift::TypeAliasDecl::getUnderlyingType() const: Assertion `!UnderlyingTy.getType().isNull() && "getting invalid underlying type"' failed.
8  swift           0x0000000000ea84f9 swift::TypeChecker::applyUnboundGenericArguments(swift::UnboundGenericType*, swift::SourceLoc, swift::DeclContext*, llvm::MutableArrayRef<swift::TypeLoc>, bool, swift::GenericTypeResolver*) + 1321
9  swift           0x0000000000ea7e7f swift::TypeChecker::applyGenericArguments(swift::Type, swift::SourceLoc, swift::DeclContext*, swift::GenericIdentTypeRepr*, bool, swift::GenericTypeResolver*) + 431
13 swift           0x0000000000ea864e 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           0x0000000000ea9564 swift::TypeChecker::resolveType(swift::TypeRepr*, swift::DeclContext*, swift::OptionSet<swift::TypeResolutionFlags, unsigned int>, swift::GenericTypeResolver*, llvm::function_ref<bool (swift::TypeCheckRequest)>*) + 164
16 swift           0x0000000000ea854a swift::TypeChecker::validateType(swift::TypeLoc&, swift::DeclContext*, swift::OptionSet<swift::TypeResolutionFlags, unsigned int>, swift::GenericTypeResolver*, llvm::function_ref<bool (swift::TypeCheckRequest)>*) + 42
17 swift           0x0000000000f6086f swift::IterativeTypeChecker::processResolveInheritedClauseEntry(std::pair<llvm::PointerUnion<swift::TypeDecl*, swift::ExtensionDecl*>, unsigned int>, llvm::function_ref<bool (swift::TypeCheckRequest)>) + 159
18 swift           0x0000000000f3f22d swift::IterativeTypeChecker::satisfy(swift::TypeCheckRequest) + 493
19 swift           0x0000000000f3f3b9 swift::IterativeTypeChecker::satisfy(swift::TypeCheckRequest) + 889
20 swift           0x0000000000e3af40 swift::TypeChecker::resolveRawType(swift::EnumDecl*) + 64
21 swift           0x00000000010848bf swift::NominalTypeDecl::prepareConformanceTable() const + 351
22 swift           0x0000000001084b7f swift::NominalTypeDecl::getImplicitProtocols(llvm::SmallVectorImpl<swift::ProtocolDecl*>&) + 15
23 swift           0x0000000000e3b52c swift::TypeChecker::checkInheritanceClause(swift::Decl*, swift::GenericTypeResolver*) + 1180
24 swift           0x0000000000e3e47f swift::TypeChecker::validateDecl(swift::ValueDecl*, bool) + 527
29 swift           0x0000000000e43ed6 swift::TypeChecker::typeCheckDecl(swift::Decl*, bool) + 150
33 swift           0x0000000000ea3736 swift::TypeChecker::typeCheckTopLevelCodeDecl(swift::TopLevelCodeDecl*) + 134
34 swift           0x0000000000e671bd swift::performTypeChecking(swift::SourceFile&, swift::TopLevelContext&, swift::OptionSet<swift::TypeCheckingFlags, unsigned int>, unsigned int) + 1149
35 swift           0x0000000000cb9d8f swift::CompilerInstance::performSema() + 3087
37 swift           0x000000000078ab9b frontend_main(llvm::ArrayRef<char const*>, char const*, void*) + 2523
38 swift           0x0000000000785645 main + 2837
Stack dump:
0.	Program arguments: /path/to/swift/bin/swift -frontend -c -primary-file validation-test/compiler_crashers/28262-swift-typechecker-applyunboundgenericarguments.swift -target x86_64-unknown-linux-gnu -disable-objc-interop -module-name main -o /tmp/28262-swift-typechecker-applyunboundgenericarguments-a3dcd2.o
1.	While type-checking 'S' at validation-test/compiler_crashers/28262-swift-typechecker-applyunboundgenericarguments.swift:8:4
2.	While resolving type d<T> at [validation-test/compiler_crashers/28262-swift-typechecker-applyunboundgenericarguments.swift:8:20 - line:8:23] RangeText="d<T>"
<unknown>:0: error: unable to execute command: Aborted
<unknown>:0: error: compile command failed due to signal (use -v to see invocation)
```
2016-03-11 21:02:21 +01:00
practicalswift
87cda49520 [swiftc] Add test case for crash triggered in swift::TypeChecker::validateDecl(swift::ValueDecl*, bool)
Stack trace:

```
swift: /path/to/swift/lib/Sema/TypeCheckDecl.cpp:6379: void swift::TypeChecker::validateDecl(swift::ValueDecl *, bool): Assertion `gp->getOuterParameters() == proto->getDeclContext()->getGenericParamsOfContext()' failed.
8  swift           0x0000000000e417fe swift::TypeChecker::validateDecl(swift::ValueDecl*, bool) + 7134
9  swift           0x000000000107b82c swift::DeclContext::lookupQualified(swift::Type, swift::DeclName, unsigned int, swift::LazyResolver*, llvm::SmallVectorImpl<swift::ValueDecl*>&) const + 3612
10 swift           0x0000000001079ef0 swift::UnqualifiedLookup::UnqualifiedLookup(swift::DeclName, swift::DeclContext*, swift::LazyResolver*, bool, swift::SourceLoc, bool, bool) + 2384
11 swift           0x0000000000e7f38b swift::TypeChecker::lookupUnqualified(swift::DeclContext*, swift::DeclName, swift::SourceLoc, swift::OptionSet<swift::NameLookupFlags, unsigned int>) + 187
14 swift           0x0000000000eaa10e swift::TypeChecker::resolveIdentifierType(swift::DeclContext*, swift::IdentTypeRepr*, swift::OptionSet<swift::TypeResolutionFlags, unsigned int>, bool, swift::GenericTypeResolver*, llvm::function_ref<bool (swift::TypeCheckRequest)>*) + 158
16 swift           0x0000000000eab024 swift::TypeChecker::resolveType(swift::TypeRepr*, swift::DeclContext*, swift::OptionSet<swift::TypeResolutionFlags, unsigned int>, swift::GenericTypeResolver*, llvm::function_ref<bool (swift::TypeCheckRequest)>*) + 164
17 swift           0x0000000000eaa00a swift::TypeChecker::validateType(swift::TypeLoc&, swift::DeclContext*, swift::OptionSet<swift::TypeResolutionFlags, unsigned int>, swift::GenericTypeResolver*, llvm::function_ref<bool (swift::TypeCheckRequest)>*) + 42
18 swift           0x0000000000f623af swift::IterativeTypeChecker::processResolveInheritedClauseEntry(std::pair<llvm::PointerUnion<swift::TypeDecl*, swift::ExtensionDecl*>, unsigned int>, llvm::function_ref<bool (swift::TypeCheckRequest)>) + 159
19 swift           0x0000000000f40d3d swift::IterativeTypeChecker::satisfy(swift::TypeCheckRequest) + 493
20 swift           0x0000000000e3c9f9 swift::TypeChecker::resolveInheritanceClause(llvm::PointerUnion<swift::TypeDecl*, swift::ExtensionDecl*>) + 137
21 swift           0x0000000000e4015b swift::TypeChecker::validateDecl(swift::ValueDecl*, bool) + 1339
22 swift           0x0000000000e3fcf1 swift::TypeChecker::validateDecl(swift::ValueDecl*, bool) + 209
25 swift           0x0000000001073202 swift::namelookup::lookupInModule(swift::ModuleDecl*, llvm::ArrayRef<std::pair<swift::Identifier, swift::SourceLoc> >, swift::DeclName, llvm::SmallVectorImpl<swift::ValueDecl*>&, swift::NLKind, swift::namelookup::ResolutionKind, swift::LazyResolver*, swift::DeclContext const*, llvm::ArrayRef<std::pair<llvm::ArrayRef<std::pair<swift::Identifier, swift::SourceLoc> >, swift::ModuleDecl*> >) + 1122
26 swift           0x000000000107a52a swift::UnqualifiedLookup::UnqualifiedLookup(swift::DeclName, swift::DeclContext*, swift::LazyResolver*, bool, swift::SourceLoc, bool, bool) + 3978
27 swift           0x0000000000e7f38b swift::TypeChecker::lookupUnqualified(swift::DeclContext*, swift::DeclName, swift::SourceLoc, swift::OptionSet<swift::NameLookupFlags, unsigned int>) + 187
30 swift           0x0000000000e88c60 swift::TypeChecker::inferDefaultWitnesses(swift::ProtocolDecl*) + 288
31 swift           0x0000000000e69318 swift::finishTypeChecking(swift::SourceFile&) + 536
32 swift           0x0000000000cbb88a swift::CompilerInstance::performSema() + 3514
34 swift           0x000000000078ad8b frontend_main(llvm::ArrayRef<char const*>, char const*, void*) + 2523
35 swift           0x0000000000785835 main + 2837
Stack dump:
0.	Program arguments: /path/to/swift/bin/swift -frontend -c -primary-file validation-test/compiler_crashers/28263-swift-typechecker-validatedecl.swift -target x86_64-unknown-linux-gnu -disable-objc-interop -module-name main -o /tmp/28263-swift-typechecker-validatedecl-5db636.o
1.	While resolving type c at [validation-test/compiler_crashers/28263-swift-typechecker-validatedecl.swift:14:13 - line:14:13] RangeText="c"
<unknown>:0: error: unable to execute command: Aborted
<unknown>:0: error: compile command failed due to signal (use -v to see invocation)
```
2016-03-11 20:59:45 +01:00
practicalswift
4d727a2f50 [swiftc] Add test case for crash triggered in swift::IterativeTypeChecker::satisfy(swift::TypeCheckRequest)
Stack trace:

```
swift: /path/to/swift/lib/Sema/IterativeTypeChecker.cpp:103: void swift::IterativeTypeChecker::satisfy(swift::TypeCheckRequest): Assertion `isSatisfied(request)' failed.
9  swift           0x0000000000f3f3b9 swift::IterativeTypeChecker::satisfy(swift::TypeCheckRequest) + 889
10 swift           0x0000000000f3f3b9 swift::IterativeTypeChecker::satisfy(swift::TypeCheckRequest) + 889
13 swift           0x0000000000e3f115 swift::TypeChecker::validateDecl(swift::ValueDecl*, bool) + 3749
16 swift           0x0000000000e43ed6 swift::TypeChecker::typeCheckDecl(swift::Decl*, bool) + 150
17 swift           0x0000000000e67142 swift::performTypeChecking(swift::SourceFile&, swift::TopLevelContext&, swift::OptionSet<swift::TypeCheckingFlags, unsigned int>, unsigned int) + 1026
18 swift           0x0000000000cb9d8f swift::CompilerInstance::performSema() + 3087
20 swift           0x000000000078ab9b frontend_main(llvm::ArrayRef<char const*>, char const*, void*) + 2523
21 swift           0x0000000000785645 main + 2837
Stack dump:
0.	Program arguments: /path/to/swift/bin/swift -frontend -c -primary-file validation-test/compiler_crashers/28261-swift-iterativetypechecker-satisfy.swift -target x86_64-unknown-linux-gnu -disable-objc-interop -module-name main -o /tmp/28261-swift-iterativetypechecker-satisfy-2b2db1.o
1.	While type-checking 'F' at validation-test/compiler_crashers/28261-swift-iterativetypechecker-satisfy.swift:8:1
2.	While type-checking 'F' at validation-test/compiler_crashers/28261-swift-iterativetypechecker-satisfy.swift:8:1
<unknown>:0: error: unable to execute command: Aborted
<unknown>:0: error: compile command failed due to signal (use -v to see invocation)
```
2016-03-10 16:57:23 +01:00
gregomni
78b7b9681d A few final replacements of typealias with associatedtype.
Mismerge during my last commit made for a couple of leftovers that I didn't discover until now.
2016-03-09 20:45:46 -08:00
gregomni
78216b2990 Change all remaining tests that use typealias in a protocol to use associatedtype. 2016-03-09 18:08:52 -08:00
Max Moiseev
1fae0d1325 Merge remote-tracking branch 'origin/master' into swift-3-api-guidelines 2016-03-08 12:48:48 -08:00
practicalswift
a183c5fc9d [swiftc] Add test case for crash triggered in swift::constraints::ConstraintGraphNode::getMemberType(swift::Identifier, std::function<swift::TypeVariableType* ()>)
Stack trace:

```
6  swift           0x0000000000f56566 swift::constraints::ConstraintGraphNode::getMemberType(swift::Identifier, std::function<swift::TypeVariableType* ()>) + 182
7  swift           0x0000000000f5712a swift::constraints::ConstraintGraph::getMemberType(swift::TypeVariableType*, swift::Identifier, std::function<swift::TypeVariableType* ()>) + 154
9  swift           0x000000000109068d swift::Type::transform(std::function<swift::Type (swift::Type)> const&) const + 45
10 swift           0x0000000000ec5ae6 swift::constraints::ConstraintSystem::openGeneric(swift::DeclContext*, llvm::ArrayRef<swift::GenericTypeParamType*>, llvm::ArrayRef<swift::Requirement>, bool, unsigned int, swift::constraints::ConstraintLocatorBuilder, llvm::DenseMap<swift::CanType, swift::TypeVariableType*, llvm::DenseMapInfo<swift::CanType>, llvm::detail::DenseMapPair<swift::CanType, swift::TypeVariableType*> >&) + 1110
12 swift           0x000000000109068d swift::Type::transform(std::function<swift::Type (swift::Type)> const&) const + 45
13 swift           0x0000000000ec64fa swift::constraints::ConstraintSystem::getTypeOfMemberReference(swift::Type, swift::ValueDecl*, bool, bool, swift::constraints::ConstraintLocatorBuilder, swift::DeclRefExpr const*, llvm::DenseMap<swift::CanType, swift::TypeVariableType*, llvm::DenseMapInfo<swift::CanType>, llvm::detail::DenseMapPair<swift::CanType, swift::TypeVariableType*> >*) + 778
18 swift           0x0000000000e869a0 swift::TypeChecker::inferDefaultWitnesses(swift::ProtocolDecl*) + 288
19 swift           0x0000000000e67048 swift::finishTypeChecking(swift::SourceFile&) + 536
20 swift           0x0000000000cb63aa swift::CompilerInstance::performSema() + 3514
22 swift           0x000000000078a58b frontend_main(llvm::ArrayRef<char const*>, char const*, void*) + 2523
23 swift           0x0000000000785035 main + 2837
Stack dump:
0.	Program arguments: /usr/local/bin/swift/bin/swift -frontend -c -primary-file validation-test/compiler_crashers/28260-swift-constraints-constraintgraphnode-getmembertype.swift -target x86_64-unknown-linux-gnu -disable-objc-interop -module-name main -o /tmp/28260-swift-constraints-constraintgraphnode-getmembertype-a2bfc8.o
<unknown>:0: error: unable to execute command: Segmentation fault
<unknown>:0: error: compile command failed due to signal (use -v to see invocation)
```
2016-03-08 11:36:24 +01:00
Max Moiseev
7fe6916bf6 Merge remote-tracking branch 'origin/master' into swift-3-api-guidelines 2016-03-07 12:10:47 -08:00
practicalswift
4c9a2d20d0 [swiftc] Add test case for crash triggered in swift::TypeChecker::validateDecl(swift::ValueDecl*, bool)
Stack trace:

```
swift: /path/to/swift/lib/Sema/TypeCheckDecl.cpp:4372: void (anonymous namespace)::DeclChecker::visitFuncDecl(swift::FuncDecl *): Assertion `!FD->getType()->hasTypeParameter()' failed.
10 swift           0x0000000000e3d6d4 swift::TypeChecker::validateDecl(swift::ValueDecl*, bool) + 788
12 swift           0x0000000000e3d6d4 swift::TypeChecker::validateDecl(swift::ValueDecl*, bool) + 788
13 swift           0x00000000010778fc swift::DeclContext::lookupQualified(swift::Type, swift::DeclName, unsigned int, swift::LazyResolver*, llvm::SmallVectorImpl<swift::ValueDecl*>&) const + 3612
14 swift           0x0000000001075fc0 swift::UnqualifiedLookup::UnqualifiedLookup(swift::DeclName, swift::DeclContext*, swift::LazyResolver*, bool, swift::SourceLoc, bool, bool) + 2384
15 swift           0x0000000000e7c99b swift::TypeChecker::lookupUnqualified(swift::DeclContext*, swift::DeclName, swift::SourceLoc, swift::OptionSet<swift::NameLookupFlags, unsigned int>) + 187
18 swift           0x0000000000ea745e swift::TypeChecker::resolveIdentifierType(swift::DeclContext*, swift::IdentTypeRepr*, swift::OptionSet<swift::TypeResolutionFlags, unsigned int>, bool, swift::GenericTypeResolver*, llvm::function_ref<bool (swift::TypeCheckRequest)>*) + 158
20 swift           0x0000000000ea8374 swift::TypeChecker::resolveType(swift::TypeRepr*, swift::DeclContext*, swift::OptionSet<swift::TypeResolutionFlags, unsigned int>, swift::GenericTypeResolver*, llvm::function_ref<bool (swift::TypeCheckRequest)>*) + 164
21 swift           0x0000000000ea735a swift::TypeChecker::validateType(swift::TypeLoc&, swift::DeclContext*, swift::OptionSet<swift::TypeResolutionFlags, unsigned int>, swift::GenericTypeResolver*, llvm::function_ref<bool (swift::TypeCheckRequest)>*) + 42
23 swift           0x0000000000e7910c swift::TypeChecker::validateGenericFuncSignature(swift::AbstractFunctionDecl*) + 124
28 swift           0x0000000000e42f36 swift::TypeChecker::typeCheckDecl(swift::Decl*, bool) + 150
31 swift           0x0000000000ea178d swift::TypeChecker::typeCheckConstructorBodyUntil(swift::ConstructorDecl*, swift::SourceLoc) + 845
32 swift           0x0000000000ea1192 swift::TypeChecker::typeCheckAbstractFunctionBodyUntil(swift::AbstractFunctionDecl*, swift::SourceLoc) + 34
33 swift           0x0000000000ea1d38 swift::TypeChecker::typeCheckAbstractFunctionBody(swift::AbstractFunctionDecl*) + 136
35 swift           0x0000000000e662f4 swift::performTypeChecking(swift::SourceFile&, swift::TopLevelContext&, swift::OptionSet<swift::TypeCheckingFlags, unsigned int>, unsigned int) + 1300
36 swift           0x0000000000cb5b9f swift::CompilerInstance::performSema() + 3087
38 swift           0x000000000078a49b frontend_main(llvm::ArrayRef<char const*>, char const*, void*) + 2523
39 swift           0x0000000000784f45 main + 2837
Stack dump:
0.	Program arguments: /usr/local/bin/swift/bin/swift -frontend -c -primary-file validation-test/compiler_crashers/28259-swift-typechecker-validatedecl.swift -target x86_64-unknown-linux-gnu -disable-objc-interop -module-name main -o /tmp/28259-swift-typechecker-validatedecl-e3f732.o
1.	While type-checking 'init' at validation-test/compiler_crashers/28259-swift-typechecker-validatedecl.swift:8:11
2.	While type-checking 'S' at validation-test/compiler_crashers/28259-swift-typechecker-validatedecl.swift:8:18
3.	While resolving type d at [validation-test/compiler_crashers/28259-swift-typechecker-validatedecl.swift:8:35 - line:8:35] RangeText="d"
4.	While type-checking 'd' at validation-test/compiler_crashers/28259-swift-typechecker-validatedecl.swift:8:37
5.	While type-checking 'd' at validation-test/compiler_crashers/28259-swift-typechecker-validatedecl.swift:8:28
<unknown>:0: error: unable to execute command: Aborted
<unknown>:0: error: compile command failed due to signal (use -v to see invocation)
```
2016-03-07 07:46:08 +01:00
practicalswift
2b4872c4d0 [swiftc] Add test case for crash triggered in swift::SpecializedProtocolConformance::getTypeWitnessSubstAndDecl(swift::AssociatedTypeDecl*, swift::LazyResolver*) const
Stack trace:

```
swift: /path/to/swift/lib/AST/Type.cpp:2126: TypeSubstitutionMap swift::GenericParamList::getSubstitutionMap(ArrayRef<swift::Substitution>) const: Assertion `Subs.empty() && "did not use all substitutions?!"' failed.
9  swift           0x000000000105a0ea swift::SpecializedProtocolConformance::getTypeWitnessSubstAndDecl(swift::AssociatedTypeDecl*, swift::LazyResolver*) const + 202
10 swift           0x0000000001059e02 swift::ProtocolConformance::getTypeWitnessSubstAndDecl(swift::AssociatedTypeDecl*, swift::LazyResolver*) const + 18
11 swift           0x000000000105a616 swift::ProtocolConformance::getTypeWitness(swift::AssociatedTypeDecl*, swift::LazyResolver*) const + 6
12 swift           0x0000000000e5949a swift::TypeChecker::lookupMemberType(swift::DeclContext*, swift::Type, swift::Identifier, swift::OptionSet<swift::NameLookupFlags, unsigned int>) + 1066
14 swift           0x0000000000e82d7e swift::TypeChecker::resolveIdentifierType(swift::DeclContext*, swift::IdentTypeRepr*, swift::OptionSet<swift::TypeResolutionFlags, unsigned int>, bool, swift::GenericTypeResolver*, llvm::function_ref<bool (swift::TypeCheckRequest)>*) + 158
16 swift           0x0000000000e83c84 swift::TypeChecker::resolveType(swift::TypeRepr*, swift::DeclContext*, swift::OptionSet<swift::TypeResolutionFlags, unsigned int>, swift::GenericTypeResolver*, llvm::function_ref<bool (swift::TypeCheckRequest)>*) + 164
17 swift           0x0000000000e82c7a swift::TypeChecker::validateType(swift::TypeLoc&, swift::DeclContext*, swift::OptionSet<swift::TypeResolutionFlags, unsigned int>, swift::GenericTypeResolver*, llvm::function_ref<bool (swift::TypeCheckRequest)>*) + 42
18 swift           0x0000000000e1719a swift::TypeChecker::checkInheritanceClause(swift::Decl*, swift::GenericTypeResolver*) + 5274
19 swift           0x0000000000e54775 swift::TypeChecker::checkGenericParamList(swift::ArchetypeBuilder*, swift::GenericParamList*, swift::GenericSignature*, bool, swift::GenericTypeResolver*) + 357
20 swift           0x0000000000e55e97 swift::TypeChecker::validateGenericSignature(swift::GenericParamList*, swift::DeclContext*, swift::GenericSignature*, std::function<bool (swift::ArchetypeBuilder&)>, bool&) + 135
21 swift           0x0000000000e56244 swift::TypeChecker::validateGenericTypeSignature(swift::NominalTypeDecl*) + 116
22 swift           0x0000000000e18fe1 swift::TypeChecker::validateDecl(swift::ValueDecl*, bool) + 353
29 swift           0x0000000000e1e936 swift::TypeChecker::typeCheckDecl(swift::Decl*, bool) + 150
32 swift           0x0000000000e7cc4a swift::TypeChecker::typeCheckFunctionBodyUntil(swift::FuncDecl*, swift::SourceLoc) + 346
33 swift           0x0000000000e7caae swift::TypeChecker::typeCheckAbstractFunctionBodyUntil(swift::AbstractFunctionDecl*, swift::SourceLoc) + 46
34 swift           0x0000000000e7d648 swift::TypeChecker::typeCheckAbstractFunctionBody(swift::AbstractFunctionDecl*) + 136
36 swift           0x0000000000e41dd4 swift::performTypeChecking(swift::SourceFile&, swift::TopLevelContext&, swift::OptionSet<swift::TypeCheckingFlags, unsigned int>, unsigned int) + 1300
37 swift           0x0000000000cb3b5f swift::CompilerInstance::performSema() + 3087
39 swift           0x00000000007885fb frontend_main(llvm::ArrayRef<char const*>, char const*, void*) + 2523
40 swift           0x00000000007830d5 main + 2773
Stack dump:
0.	Program arguments: /usr/local/bin/swift/bin/swift -frontend -c -primary-file validation-test/compiler_crashers/28258-swift-specializedprotocolconformance-gettypewitnesssubstanddecl.swift -target x86_64-unknown-linux-gnu -disable-objc-interop -module-name main -o /tmp/28258-swift-specializedprotocolconformance-gettypewitnesssubstanddecl-a81e65.o
1.	While type-checking '<' at validation-test/compiler_crashers/28258-swift-specializedprotocolconformance-gettypewitnesssubstanddecl.swift:8:1
2.	While type-checking 'c' at validation-test/compiler_crashers/28258-swift-specializedprotocolconformance-gettypewitnesssubstanddecl.swift:8:7
3.	While resolving type A.e at [validation-test/compiler_crashers/28258-swift-specializedprotocolconformance-gettypewitnesssubstanddecl.swift:8:72 - line:8:74] RangeText="A.e"
<unknown>:0: error: unable to execute command: Aborted
<unknown>:0: error: compile command failed due to signal (use -v to see invocation)
```
2016-03-06 22:00:43 +01:00
Max Moiseev
859db53d87 Merge remote-tracking branch 'origin/master' into swift-3-api-guidelines 2016-03-01 12:56:26 -08:00
practicalswift
3148d6e411 [swiftc] Add test case for crash triggered in swift::TypeChecker::resolveTypeWitness(swift::NormalProtocolConformance const*, swift::AssociatedTypeDecl*)
Stack trace:

```
5  swift           0x0000000000e41101 swift::TypeChecker::resolveTypeWitness(swift::NormalProtocolConformance const*, swift::AssociatedTypeDecl*) + 225
6  swift           0x00000000010341a6 swift::NormalProtocolConformance::getTypeWitnessSubstAndDecl(swift::AssociatedTypeDecl*, swift::LazyResolver*) const + 150
7  swift           0x00000000010340e8 swift::ProtocolConformance::getTypeWitnessSubstAndDecl(swift::AssociatedTypeDecl*, swift::LazyResolver*) const + 40
8  swift           0x00000000010348e6 swift::ProtocolConformance::getTypeWitness(swift::AssociatedTypeDecl*, swift::LazyResolver*) const + 6
11 swift           0x0000000000f1f058 swift::ArchetypeBuilder::addSuperclassRequirement(swift::ArchetypeBuilder::PotentialArchetype*, swift::Type, swift::RequirementSource) + 248
14 swift           0x0000000000f20d4f swift::ArchetypeBuilder::visitInherited(llvm::ArrayRef<swift::TypeLoc>, llvm::function_ref<bool (swift::Type, swift::SourceLoc)>) + 175
15 swift           0x0000000000f1eb4a swift::ArchetypeBuilder::addAbstractTypeParamRequirements(swift::AbstractTypeParamDecl*, swift::ArchetypeBuilder::PotentialArchetype*, swift::RequirementSource::Kind, llvm::SmallPtrSetImpl<swift::ProtocolDecl*>&) + 426
16 swift           0x0000000000f1eed7 swift::ArchetypeBuilder::addConformanceRequirement(swift::ArchetypeBuilder::PotentialArchetype*, swift::ProtocolDecl*, swift::RequirementSource, llvm::SmallPtrSetImpl<swift::ProtocolDecl*>&) + 471
19 swift           0x0000000000f20d4f swift::ArchetypeBuilder::visitInherited(llvm::ArrayRef<swift::TypeLoc>, llvm::function_ref<bool (swift::Type, swift::SourceLoc)>) + 175
20 swift           0x0000000000f1eb4a swift::ArchetypeBuilder::addAbstractTypeParamRequirements(swift::AbstractTypeParamDecl*, swift::ArchetypeBuilder::PotentialArchetype*, swift::RequirementSource::Kind, llvm::SmallPtrSetImpl<swift::ProtocolDecl*>&) + 426
21 swift           0x0000000000f1e97c swift::ArchetypeBuilder::addGenericParameterRequirements(swift::GenericTypeParamDecl*) + 172
22 swift           0x0000000000e34427 swift::TypeChecker::checkGenericParamList(swift::ArchetypeBuilder*, swift::GenericParamList*, swift::GenericSignature*, bool, swift::GenericTypeResolver*) + 375
23 swift           0x0000000000e35b37 swift::TypeChecker::validateGenericSignature(swift::GenericParamList*, swift::DeclContext*, swift::GenericSignature*, std::function<bool (swift::ArchetypeBuilder&)>, bool&) + 135
24 swift           0x0000000000e35ee4 swift::TypeChecker::validateGenericTypeSignature(swift::NominalTypeDecl*) + 116
25 swift           0x0000000000df9bd4 swift::TypeChecker::validateDecl(swift::ValueDecl*, bool) + 1300
28 swift           0x0000000000dff206 swift::TypeChecker::typeCheckDecl(swift::Decl*, bool) + 150
29 swift           0x0000000000e22092 swift::performTypeChecking(swift::SourceFile&, swift::TopLevelContext&, swift::OptionSet<swift::TypeCheckingFlags, unsigned int>, unsigned int) + 1026
30 swift           0x0000000000c97b9f swift::CompilerInstance::performSema() + 3167
32 swift           0x000000000077705b frontend_main(llvm::ArrayRef<char const*>, char const*, void*) + 2523
33 swift           0x0000000000771b25 main + 2773
Stack dump:
0.	Program arguments: /usr/local/bin/swift/bin/swift -frontend -c -primary-file validation-test/compiler_crashers/28257-swift-typechecker-resolvetypewitness.swift -target x86_64-unknown-linux-gnu -disable-objc-interop -module-name main -o /tmp/28257-swift-typechecker-resolvetypewitness-eec025.o
1.	While type-checking 'A' at validation-test/compiler_crashers/28257-swift-typechecker-resolvetypewitness.swift:7:1
<unknown>:0: error: unable to execute command: Segmentation fault
<unknown>:0: error: compile command failed due to signal (use -v to see invocation)
```
2016-02-29 23:48:24 +01:00
Max Moiseev
a49dab6bf8 Merge remote-tracking branch 'origin/master' into swift-3-api-guidelines 2016-02-29 12:08:52 -08:00
Slava Pestov
6812b6926b Sema: Cleanups and minor fixes for protocol 'Self' types
We had four duplicated implementations of checking how a protocol
requirement uses 'Self', all slightly wrong or incomplete:

- When deciding if the protocol type can be used as an existential.
  This one would just ignore 'Self' in the return type of a method
  completely, which was incorrect for cases where 'Self' is
  contravariant but part of the return value, for example:

  func foo() -> (Self -> ())

- When deciding if a member access can be performed on an existential
  value. This is distinct from the former, because the member may
  have been defined in a protocol extension, in which case it cannot
  be used even if the protocol type can be used as an existential.
  Unfortunately, this implementation was overly conservative, and
  would reject uses of 'Self' where Sema could in fact erase the
  existential type, for example:

  func foo() -> Self??
  func foo() -> Self.Type
  func foo() -> (Self, Self)

  This function handled function return types correctly, effectively
  plugging the leak in the previous code. It did lead to inconsistent
  behavior with protocols that had contravariant Self in requirements
  though; sometimes we would diagnose uses of the existential type,
  other times we would only complain about specific members.

- When deciding if a method in a non-final class can model a protocol
  requirement. This one was the most elaborate one, but here
  contravariance and uses of associated types are actually okay, so
  it was written to pick up covariant 'Self' only. However, it also
  did not handle metatypes and tuples.

- When opening the type of member of an existential, we would check
  if the return value was 'Self' or an optional of 'Self', but again
  this check was too conservative, so after the previous three were
  fixed, we could reference members on existentials that did not
  have a correct opened type.

Now, these have been combined into one check. To fix some crashes,
Sema's implementation of erasing existentials now relies on
coerceToType() instead of hand-rolling a few coercions of its own,
and wrapping the rest in CovariantFunctionConversionExpr, which
didn't make much sense if the result was not a function type.

SILGen still does not support function type conversions where an
existential return value is being erased; these would silently
miscompile before, but crash with an assertion now, because they
are correctly modeled as a FunctionConversionExpr, and not
CovariantFunctionConversionExpr.
2016-02-28 23:52:35 -08:00
Dmitri Gribenko
a257715fcc Revert "[stdlib] [SE-0031] update stdlib for SE-0031 (inout adjustment)" 2016-02-26 11:17:10 -08:00
Daniel Duan
13b5c8f3bc [SE-0031] update code base for SE-0031 (inout adjustment) 2016-02-26 10:52:10 -08:00
Dmitri Gribenko
0f36bec31f Merge remote-tracking branch 'origin/master' into swift-3-api-guidelines 2016-02-18 16:41:35 -08:00
Dmitri Gribenko
dd75aed67a Merge remote-tracking branch 'origin/master' into swift-3-api-guidelines 2016-02-17 14:40:05 -08:00
practicalswift
ef01faf32d [swiftc] Add test case for crash triggered in swift::Decl::dump(llvm::raw_ostream&, unsigned int) const
Stack trace:

```
13 swift           0x0000000000f2f1a8 swift::Decl::dump(llvm::raw_ostream&, unsigned int) const + 152
18 swift           0x0000000000f2f1a8 swift::Decl::dump(llvm::raw_ostream&, unsigned int) const + 152
27 swift           0x0000000000f6d024 swift::Decl::walk(swift::ASTWalker&) + 20
28 swift           0x0000000001000a6e swift::SourceFile::walk(swift::ASTWalker&) + 174
29 swift           0x0000000000f53324 swift::verify(swift::SourceFile&) + 52
30 swift           0x0000000000dcd4e4 swift::performTypeChecking(swift::SourceFile&, swift::TopLevelContext&, swift::OptionSet<swift::TypeCheckingFlags, unsigned int>, unsigned int) + 1492
31 swift           0x0000000000c8023f swift::CompilerInstance::performSema() + 2975
33 swift           0x0000000000774691 frontend_main(llvm::ArrayRef<char const*>, char const*, void*) + 2481
34 swift           0x000000000076f1d5 main + 2773
Stack dump:
0.	Program arguments: /path/to/build/Ninja-ReleaseAssert/swift-linux-x86_64/bin/swift -frontend -c -primary-file validation-test/compiler_crashers/28255-swift-decl-dump.swift -target x86_64-unknown-linux-gnu -disable-objc-interop -module-name main -o /tmp/28255-swift-decl-dump-ac2682.o
1.	While walking into decl 'Q' at validation-test/compiler_crashers/28255-swift-decl-dump.swift:8:1
2.	While walking into body of 'Q' at validation-test/compiler_crashers/28255-swift-decl-dump.swift:8:1
3.	While verifying overridden 'init' at validation-test/compiler_crashers/28255-swift-decl-dump.swift:8:23
<unknown>:0: error: unable to execute command: Aborted
<unknown>:0: error: compile command failed due to signal (use -v to see invocation)
```
2016-02-16 22:30:17 +01:00
Max Moiseev
3a3984877a Merge remote-tracking branch 'origin/master' into swift-3-api-guidelines 2016-02-15 15:43:34 -08:00
Slava Pestov
27aad39c79 This test already passes on master 2016-02-11 23:51:47 -08:00
practicalswift
36267e37b6 [swiftc] Add test case for crash triggered in swift::EnumElementDecl::getArgumentInterfaceType() const
Stack trace:

```
swift: /path/to/llvm/include/llvm/Support/Casting.h:237: typename cast_retty<X, Y *>::ret_type llvm::cast(Y *) [X = swift::AnyFunctionType, Y = swift::TypeBase]: Assertion `isa<X>(Val) && "cast<Ty>() argument of incompatible type!"' failed.
8  swift           0x0000000000fcfc9d swift::EnumElementDecl::getArgumentInterfaceType() const + 157
10 swift           0x0000000000dfa99c swift::TypeChecker::checkDeclCircularity(swift::NominalTypeDecl*) + 268
12 swift           0x0000000000df9296 swift::TypeChecker::typeCheckDecl(swift::Decl*, bool) + 150
13 swift           0x0000000000dc613a swift::performTypeChecking(swift::SourceFile&, swift::TopLevelContext&, swift::OptionSet<swift::TypeCheckingFlags, unsigned int>, unsigned int) + 1178
14 swift           0x0000000000c7970f swift::CompilerInstance::performSema() + 2975
16 swift           0x0000000000774901 frontend_main(llvm::ArrayRef<char const*>, char const*, void*) + 2481
17 swift           0x000000000076f445 main + 2773
Stack dump:
0.	Program arguments: /path/to/build/Ninja-ReleaseAssert/swift-linux-x86_64/bin/swift -frontend -c -primary-file validation-test/compiler_crashers/28254-swift-enumelementdecl-getargumentinterfacetype.swift -target x86_64-unknown-linux-gnu -disable-objc-interop -module-name main -o /tmp/28254-swift-enumelementdecl-getargumentinterfacetype-6528cf.o
1.	While type-checking 'B' at validation-test/compiler_crashers/28254-swift-enumelementdecl-getargumentinterfacetype.swift:8:1
<unknown>:0: error: unable to execute command: Aborted
<unknown>:0: error: compile command failed due to signal (use -v to see invocation)
```
2016-02-12 07:29:48 +01:00
practicalswift
97d840f06f [swiftc] Add test case for crash triggered in swift::constraints::ConstraintSystem::matchDeepEqualityTypes(swift::Type, swift::Type, swift::constraints::ConstraintLocatorBuilder)
Stack trace:

```
swift: /path/to/swift/lib/Sema/CSSimplify.cpp:976: ConstraintSystem::SolutionKind swift::constraints::ConstraintSystem::matchDeepEqualityTypes(swift::Type, swift::Type, swift::constraints::ConstraintLocatorBuilder): Assertion `(bool)nominal1->getParent() == (bool)nominal2->getParent() && "Mismatched parents of nominal types"' failed.
8  swift           0x0000000000ebd1e8 swift::constraints::ConstraintSystem::matchDeepEqualityTypes(swift::Type, swift::Type, swift::constraints::ConstraintLocatorBuilder) + 1000
9  swift           0x0000000000ebda5b swift::constraints::ConstraintSystem::simplifyRestrictedConstraint(swift::constraints::ConversionRestrictionKind, swift::Type, swift::Type, swift::constraints::TypeMatchKind, unsigned int, swift::constraints::ConstraintLocatorBuilder) + 1019
10 swift           0x0000000000ebb264 swift::constraints::ConstraintSystem::matchTypes(swift::Type, swift::Type, swift::constraints::TypeMatchKind, unsigned int, swift::constraints::ConstraintLocatorBuilder) + 9988
11 swift           0x0000000000ec502c swift::constraints::ConstraintSystem::simplifyConstraint(swift::constraints::Constraint const&) + 652
12 swift           0x0000000000e5f857 swift::constraints::ConstraintSystem::addConstraint(swift::constraints::Constraint*, bool, bool) + 23
13 swift           0x0000000000e62464 swift::constraints::ConstraintSystem::getTypeOfMemberReference(swift::Type, swift::ValueDecl*, bool, bool, swift::constraints::ConstraintLocatorBuilder, swift::DeclRefExpr const*, llvm::DenseMap<swift::CanType, swift::TypeVariableType*, llvm::DenseMapInfo<swift::CanType>, llvm::detail::DenseMapPair<swift::CanType, swift::TypeVariableType*> >*) + 3252
14 swift           0x0000000000e62de7 swift::constraints::ConstraintSystem::resolveOverload(swift::constraints::ConstraintLocator*, swift::Type, swift::constraints::OverloadChoice) + 519
15 swift           0x0000000000ec5143 swift::constraints::ConstraintSystem::simplifyConstraint(swift::constraints::Constraint const&) + 931
16 swift           0x0000000000e5f857 swift::constraints::ConstraintSystem::addConstraint(swift::constraints::Constraint*, bool, bool) + 23
19 swift           0x0000000000f665d5 swift::Expr::walk(swift::ASTWalker&) + 69
20 swift           0x0000000000ea3e48 swift::constraints::ConstraintSystem::generateConstraints(swift::Expr*) + 200
21 swift           0x0000000000dd7b30 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>) + 256
22 swift           0x0000000000dde0e9 swift::TypeChecker::typeCheckExpression(swift::Expr*&, swift::DeclContext*, swift::Type, swift::ContextualTypePurpose, swift::OptionSet<swift::TypeCheckExprFlags, unsigned int>, swift::ExprTypeCheckListener*) + 569
26 swift           0x0000000000e4064a swift::TypeChecker::typeCheckFunctionBodyUntil(swift::FuncDecl*, swift::SourceLoc) + 362
27 swift           0x0000000000e4049e swift::TypeChecker::typeCheckAbstractFunctionBodyUntil(swift::AbstractFunctionDecl*, swift::SourceLoc) + 46
28 swift           0x0000000000e41068 swift::TypeChecker::typeCheckAbstractFunctionBody(swift::AbstractFunctionDecl*) + 136
30 swift           0x0000000000dc61b4 swift::performTypeChecking(swift::SourceFile&, swift::TopLevelContext&, swift::OptionSet<swift::TypeCheckingFlags, unsigned int>, unsigned int) + 1300
31 swift           0x0000000000c7970f swift::CompilerInstance::performSema() + 2975
33 swift           0x0000000000774901 frontend_main(llvm::ArrayRef<char const*>, char const*, void*) + 2481
34 swift           0x000000000076f445 main + 2773
Stack dump:
0.	Program arguments: /path/to/build/Ninja-ReleaseAssert/swift-linux-x86_64/bin/swift -frontend -c -primary-file validation-test/compiler_crashers/28253-swift-constraints-constraintsystem-matchdeepequalitytypes.swift -target x86_64-unknown-linux-gnu -disable-objc-interop -module-name main -o /tmp/28253-swift-constraints-constraintsystem-matchdeepequalitytypes-09a3bc.o
1.	While type-checking getter for b at validation-test/compiler_crashers/28253-swift-constraints-constraintsystem-matchdeepequalitytypes.swift:12:5
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)
```
2016-02-11 23:21:40 +01:00
practicalswift
18815fefe0 [swiftc] Add test case for crash triggered in swift::constraints::ConstraintSystem::assignFixedType(swift::TypeVariableType*, swift::Type, bool)
Stack trace:

```
swift: /path/to/swift/lib/Sema/ConstraintGraph.cpp:207: void swift::constraints::ConstraintGraphNode::addFixedBinding(swift::TypeVariableType *): Assertion `!adjacency.FixedBinding && "Already marked as a fixed binding?"' failed.
9  swift           0x0000000000e5e66e swift::constraints::ConstraintSystem::assignFixedType(swift::TypeVariableType*, swift::Type, bool) + 382
10 swift           0x0000000000eb9c3e swift::constraints::ConstraintSystem::matchTypes(swift::Type, swift::Type, swift::constraints::TypeMatchKind, unsigned int, swift::constraints::ConstraintLocatorBuilder) + 4318
11 swift           0x0000000000ebc2cc swift::constraints::ConstraintSystem::matchTypes(swift::Type, swift::Type, swift::constraints::TypeMatchKind, unsigned int, swift::constraints::ConstraintLocatorBuilder) + 14188
12 swift           0x0000000000ebf8f2 swift::constraints::ConstraintSystem::simplifyFixConstraint(swift::constraints::Fix, swift::Type, swift::Type, swift::constraints::TypeMatchKind, unsigned int, swift::constraints::ConstraintLocatorBuilder) + 482
13 swift           0x0000000000ec4eeb swift::constraints::ConstraintSystem::simplifyConstraint(swift::constraints::Constraint const&) + 331
14 swift           0x0000000000ecdeaa swift::constraints::ConstraintSystem::solveSimplified(llvm::SmallVectorImpl<swift::constraints::Solution>&, swift::FreeTypeVariableBinding) + 3242
15 swift           0x0000000000ecb8e5 swift::constraints::ConstraintSystem::solveRec(llvm::SmallVectorImpl<swift::constraints::Solution>&, swift::FreeTypeVariableBinding) + 325
16 swift           0x0000000000ecf533 swift::constraints::ConstraintSystem::solveSimplified(llvm::SmallVectorImpl<swift::constraints::Solution>&, swift::FreeTypeVariableBinding) + 9011
17 swift           0x0000000000ecb8e5 swift::constraints::ConstraintSystem::solveRec(llvm::SmallVectorImpl<swift::constraints::Solution>&, swift::FreeTypeVariableBinding) + 325
18 swift           0x0000000000ecdf70 swift::constraints::ConstraintSystem::solveSimplified(llvm::SmallVectorImpl<swift::constraints::Solution>&, swift::FreeTypeVariableBinding) + 3440
19 swift           0x0000000000ecb8e5 swift::constraints::ConstraintSystem::solveRec(llvm::SmallVectorImpl<swift::constraints::Solution>&, swift::FreeTypeVariableBinding) + 325
20 swift           0x0000000000ecf533 swift::constraints::ConstraintSystem::solveSimplified(llvm::SmallVectorImpl<swift::constraints::Solution>&, swift::FreeTypeVariableBinding) + 9011
21 swift           0x0000000000ecb8e5 swift::constraints::ConstraintSystem::solveRec(llvm::SmallVectorImpl<swift::constraints::Solution>&, swift::FreeTypeVariableBinding) + 325
22 swift           0x0000000000ecdf70 swift::constraints::ConstraintSystem::solveSimplified(llvm::SmallVectorImpl<swift::constraints::Solution>&, swift::FreeTypeVariableBinding) + 3440
23 swift           0x0000000000ecb8e5 swift::constraints::ConstraintSystem::solveRec(llvm::SmallVectorImpl<swift::constraints::Solution>&, swift::FreeTypeVariableBinding) + 325
24 swift           0x0000000000e89968 swift::constraints::ConstraintSystem::salvage(llvm::SmallVectorImpl<swift::constraints::Solution>&, swift::Expr*) + 120
25 swift           0x0000000000dd7cc5 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>) + 661
26 swift           0x0000000000dde0e9 swift::TypeChecker::typeCheckExpression(swift::Expr*&, swift::DeclContext*, swift::Type, swift::ContextualTypePurpose, swift::OptionSet<swift::TypeCheckExprFlags, unsigned int>, swift::ExprTypeCheckListener*) + 569
29 swift           0x0000000000e4199a swift::TypeChecker::typeCheckClosureBody(swift::ClosureExpr*) + 218
30 swift           0x0000000000e6b20c swift::constraints::ConstraintSystem::applySolution(swift::constraints::Solution&, swift::Expr*, swift::Type, bool, bool, bool) + 812
31 swift           0x0000000000dde15b swift::TypeChecker::typeCheckExpression(swift::Expr*&, swift::DeclContext*, swift::Type, swift::ContextualTypePurpose, swift::OptionSet<swift::TypeCheckExprFlags, unsigned int>, swift::ExprTypeCheckListener*) + 683
33 swift           0x0000000000e41ae6 swift::TypeChecker::typeCheckTopLevelCodeDecl(swift::TopLevelCodeDecl*) + 134
34 swift           0x0000000000dc611d swift::performTypeChecking(swift::SourceFile&, swift::TopLevelContext&, swift::OptionSet<swift::TypeCheckingFlags, unsigned int>, unsigned int) + 1149
35 swift           0x0000000000c7970f swift::CompilerInstance::performSema() + 2975
37 swift           0x0000000000774901 frontend_main(llvm::ArrayRef<char const*>, char const*, void*) + 2481
38 swift           0x000000000076f445 main + 2773
Stack dump:
0.	Program arguments: /path/to/build/Ninja-ReleaseAssert/swift-linux-x86_64/bin/swift -frontend -c -primary-file validation-test/compiler_crashers/28252-swift-constraints-constraintsystem-assignfixedtype.swift -target x86_64-unknown-linux-gnu -disable-objc-interop -module-name main -o /tmp/28252-swift-constraints-constraintsystem-assignfixedtype-98f056.o
1.	While type-checking expression at [validation-test/compiler_crashers/28252-swift-constraints-constraintsystem-assignfixedtype.swift:8:1 - line:8:21] RangeText="{println(""""?struct{"
2.	While type-checking expression at [validation-test/compiler_crashers/28252-swift-constraints-constraintsystem-assignfixedtype.swift:8:2 - line:8:14] RangeText="println(""""?"
<unknown>:0: error: unable to execute command: Aborted
<unknown>:0: error: compile command failed due to signal (use -v to see invocation)
```
2016-02-11 22:31:32 +01:00
Max Moiseev
55fde4c923 making tests pass 2016-02-10 16:08:40 -08:00
Chris Lattner
42bc090d43 Fix compiler_crashers/28218-swift-valuedecl-settype.swift
In some completely insane cases, typechecking an EnumElementDecl
can recursively reference itself.  Make sure to produce an error
and bail out when this happens.
2016-02-09 21:46:56 -08:00
Chris Lattner
c70923e1fb Fix compiler_crashers/28220-swift-lvaluetype-get.swift by being more
careful about type transforming that produces an ErrorType.
2016-02-09 21:34:15 -08:00
Slava Pestov
6f7701481c Merge pull request #1075 from dduan/sema_circularity_pr
[Sema] implement better type circularity check
2016-02-08 11:04:28 -08:00
Daniel Duan
6bf8bde92b update tests to reflect changes in previous commit 2016-02-07 22:10:47 -08:00
practicalswift
e9a7b8a1a0 [swiftc] Mark twelve crashes as duplicates of other crashes in the repo.
Two crashes are defined as duplicate if they give the same output for:

$ swiftc FILENAME 2>&1 | \
    grep -E "0x[0-9a-f]" | \
    grep -E '(swift|llvm)::' | \
    grep -vE '(llvm::sys::|frontend_main)' | \
    awk '{ $1=$2=$3=""; print $0 }' | \
    sed 's/^ *//g' | \
    grep -E '(swift|llvm)::' | \
    head -1
2016-02-07 21:40:09 -08:00
practicalswift
29b93b4b19 [swiftc] Add test case for crash triggered in swift::TypeChecker::typeCheckDecl(swift::Decl*, bool)
Stack trace:

```
swift: /path/to/swift/lib/Sema/TypeCheckDecl.cpp:3991: void (anonymous namespace)::DeclChecker::visitFuncDecl(swift::FuncDecl *): Assertion `!FD->getType()->hasTypeParameter()' failed.
10 swift           0x0000000000e06976 swift::TypeChecker::typeCheckDecl(swift::Decl*, bool) + 150
11 swift           0x0000000000e5e7c5 swift::addTrivialAccessorsToStorage(swift::AbstractStorageDecl*, swift::TypeChecker&) + 469
12 swift           0x0000000000e626c4 swift::maybeAddAccessorsToVariable(swift::VarDecl*, swift::TypeChecker&) + 852
13 swift           0x0000000000e018f9 swift::TypeChecker::validateDecl(swift::ValueDecl*, bool) + 2297
14 swift           0x0000000000df81bf swift::TypeChecker::getTypeOfRValue(swift::ValueDecl*, bool) + 15
15 swift           0x0000000000e629ab swift::createImplicitConstructor(swift::TypeChecker&, swift::NominalTypeDecl*, swift::ImplicitConstructorKind) + 539
16 swift           0x0000000000e0c109 swift::TypeChecker::addImplicitConstructors(swift::NominalTypeDecl*) + 1417
19 swift           0x0000000000e06976 swift::TypeChecker::typeCheckDecl(swift::Decl*, bool) + 150
22 swift           0x0000000000e4daaa swift::TypeChecker::typeCheckClosureBody(swift::ClosureExpr*) + 218
23 swift           0x0000000000e7724c swift::constraints::ConstraintSystem::applySolution(swift::constraints::Solution&, swift::Expr*, swift::Type, bool, bool, bool) + 812
24 swift           0x0000000000deb87b swift::TypeChecker::typeCheckExpression(swift::Expr*&, swift::DeclContext*, swift::Type, swift::ContextualTypePurpose, swift::OptionSet<swift::TypeCheckExprFlags, unsigned int>, swift::ExprTypeCheckListener*) + 683
25 swift           0x0000000000dec9b2 swift::TypeChecker::typeCheckBinding(swift::Pattern*&, swift::Expr*&, swift::DeclContext*) + 162
26 swift           0x0000000000decb8b swift::TypeChecker::typeCheckPatternBinding(swift::PatternBindingDecl*, unsigned int) + 267
31 swift           0x0000000000e06976 swift::TypeChecker::typeCheckDecl(swift::Decl*, bool) + 150
32 swift           0x0000000000dd2732 swift::performTypeChecking(swift::SourceFile&, swift::TopLevelContext&, swift::OptionSet<swift::TypeCheckingFlags, unsigned int>, unsigned int) + 1490
33 swift           0x0000000000c7936f swift::CompilerInstance::performSema() + 2975
35 swift           0x0000000000777461 frontend_main(llvm::ArrayRef<char const*>, char const*, void*) + 2481
36 swift           0x0000000000772045 main + 2773
Stack dump:
0.	Program arguments: /path/to/build/Ninja-ReleaseAssert/swift-linux-x86_64/bin/swift -frontend -c -primary-file validation-test/compiler_crashers/28250-swift-typechecker-typecheckdecl.swift -target x86_64-unknown-linux-gnu -disable-objc-interop -module-name main -o /tmp/28250-swift-typechecker-typecheckdecl-302629.o
1.	While type-checking 'B' at validation-test/compiler_crashers/28250-swift-typechecker-typecheckdecl.swift:8:1
2.	While type-checking expression at [validation-test/compiler_crashers/28250-swift-typechecker-typecheckdecl.swift:8:17 - line:9:9] RangeText="{struct d{typealias e:B
3.	While type-checking 'd' at validation-test/compiler_crashers/28250-swift-typechecker-typecheckdecl.swift:8:18
4.	While type-checking getter for t at validation-test/compiler_crashers/28250-swift-typechecker-typecheckdecl.swift:9:5
<unknown>:0: error: unable to execute command: Aborted
<unknown>:0: error: compile command failed due to signal (use -v to see invocation)
```
2016-02-07 21:40:09 -08:00
Chris Lattner
cfba369f94 Merge pull request #1226 from practicalswift/swiftc-28251-swift-typechecker-addimplicitconstructors
[swiftc] Add test case for crash triggered in swift::TypeChecker::addImplicitConstructors(…)
2016-02-07 09:38:54 -08:00
practicalswift
c64e1049ac [swiftc] Add test case for crash triggered in swift::TypeChecker::addImplicitConstructors(swift::NominalTypeDecl*)
Stack trace:

```
swift: /path/to/swift/lib/Sema/TypeCheckDecl.cpp:6690: void swift::TypeChecker::addImplicitConstructors(swift::NominalTypeDecl *): Assertion `!classDecl->hasSuperclass() || classDecl->getSuperclass()->getAnyNominal()->isInvalid() || classDecl->getSuperclass()->getAnyNominal() ->addedImplicitInitializers()' failed.
8  swift           0x0000000000e10c96 swift::TypeChecker::addImplicitConstructors(swift::NominalTypeDecl*) + 4390
9  swift           0x0000000000e03522 swift::TypeChecker::checkInheritanceClause(swift::Decl*, swift::GenericTypeResolver*) + 5986
10 swift           0x0000000000e0575f swift::TypeChecker::validateDecl(swift::ValueDecl*, bool) + 1903
11 swift           0x000000000100c57c swift::DeclContext::lookupQualified(swift::Type, swift::DeclName, unsigned int, swift::LazyResolver*, llvm::SmallVectorImpl<swift::ValueDecl*>&) const + 2892
12 swift           0x000000000100af30 swift::UnqualifiedLookup::UnqualifiedLookup(swift::DeclName, swift::DeclContext*, swift::LazyResolver*, bool, swift::SourceLoc, bool, bool) + 2384
13 swift           0x0000000000e2cabb swift::TypeChecker::lookupUnqualified(swift::DeclContext*, swift::DeclName, swift::SourceLoc, swift::OptionSet<swift::NameLookupFlags, unsigned int>) + 187
16 swift           0x0000000000e5643e swift::TypeChecker::resolveIdentifierType(swift::DeclContext*, swift::IdentTypeRepr*, swift::OptionSet<swift::TypeResolutionFlags, unsigned int>, bool, swift::GenericTypeResolver*, llvm::function_ref<bool (swift::TypeCheckRequest)>*) + 158
18 swift           0x0000000000e573b4 swift::TypeChecker::resolveType(swift::TypeRepr*, swift::DeclContext*, swift::OptionSet<swift::TypeResolutionFlags, unsigned int>, swift::GenericTypeResolver*, llvm::function_ref<bool (swift::TypeCheckRequest)>*) + 164
19 swift           0x0000000000e5634a swift::TypeChecker::validateType(swift::TypeLoc&, swift::DeclContext*, swift::OptionSet<swift::TypeResolutionFlags, unsigned int>, swift::GenericTypeResolver*, llvm::function_ref<bool (swift::TypeCheckRequest)>*) + 42
20 swift           0x0000000000e030ea swift::TypeChecker::checkInheritanceClause(swift::Decl*, swift::GenericTypeResolver*) + 4906
21 swift           0x0000000000e0575f swift::TypeChecker::validateDecl(swift::ValueDecl*, bool) + 1903
26 swift           0x0000000000e0a966 swift::TypeChecker::typeCheckDecl(swift::Decl*, bool) + 150
27 swift           0x0000000000dd6722 swift::performTypeChecking(swift::SourceFile&, swift::TopLevelContext&, swift::OptionSet<swift::TypeCheckingFlags, unsigned int>, unsigned int) + 1490
28 swift           0x0000000000c7c65f swift::CompilerInstance::performSema() + 2975
30 swift           0x0000000000777ce1 frontend_main(llvm::ArrayRef<char const*>, char const*, void*) + 2481
31 swift           0x00000000007728c5 main + 2773
Stack dump:
0.	Program arguments: /path/to/build/Ninja-ReleaseAssert/swift-linux-x86_64/bin/swift -frontend -c -primary-file validation-test/compiler_crashers/28251-swift-typechecker-addimplicitconstructors.swift -target x86_64-unknown-linux-gnu -disable-objc-interop -module-name main -o /tmp/28251-swift-typechecker-addimplicitconstructors-e1f071.o
1.	While type-checking 'w' at validation-test/compiler_crashers/28251-swift-typechecker-addimplicitconstructors.swift:8:1
2.	While resolving type a at [validation-test/compiler_crashers/28251-swift-typechecker-addimplicitconstructors.swift:8:16 - line:8:16] RangeText="a"
<unknown>:0: error: unable to execute command: Aborted
<unknown>:0: error: compile command failed due to signal (use -v to see invocation)
```
2016-02-07 09:59:58 +01:00
jopamer
b11f7dbade Merge pull request #1224 from practicalswift/swiftc-28250-swift-typechecker-typecheckdecl
[swiftc] Add test case for crash triggered in swift::TypeChecker::typeCheckDecl(…)
2016-02-06 21:53:55 -08:00