Chris Lattner
675ca03b12
fix a compiler crasher that practicalswift recently found.
2016-01-08 23:03:18 -08:00
Jacob Bandes-Storch
ce2f5d6ba8
[Sema] Skip ErrorTypes in potential bindings during constraint solving
2016-01-08 22:45:52 -08:00
Jacob Bandes-Storch
824c1c043b
[Sema] Fix crash in addCurriedSelfType
...
isGenericContext() returning true doesn’t necessarily imply that getGenericSignature() returns non-null. getGenericSignatureOfContext() performs a traversal equivalent to isGenericContext(), so we use it instead.
2016-01-08 22:08:46 -08:00
practicalswift
42002a8863
[swiftc] Add test case for crash triggered in swift::constraints::ConstraintSystem::resolveOverload(swift::constraints::ConstraintLocator*, swift::Type, swift::constraints::OverloadChoice)
...
Stack trace:
```
swift: /path/to/swift/lib/Sema/ConstraintSystem.cpp:1399: 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 0x0000000000e8a1da swift::constraints::ConstraintSystem::resolveOverload(swift::constraints::ConstraintLocator*, swift::Type, swift::constraints::OverloadChoice) + 4058
9 swift 0x0000000000ee45c1 swift::constraints::ConstraintSystem::simplifyConstraint(swift::constraints::Constraint const&) + 897
10 swift 0x0000000000eeda26 swift::constraints::ConstraintSystem::solveSimplified(llvm::SmallVectorImpl<swift::constraints::Solution>&, swift::FreeTypeVariableBinding) + 3142
11 swift 0x0000000000eeb4c9 swift::constraints::ConstraintSystem::solveRec(llvm::SmallVectorImpl<swift::constraints::Solution>&, swift::FreeTypeVariableBinding) + 313
12 swift 0x0000000000eeb289 swift::constraints::ConstraintSystem::solve(llvm::SmallVectorImpl<swift::constraints::Solution>&, swift::FreeTypeVariableBinding) + 73
13 swift 0x0000000000dfe2a6 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>) + 614
14 swift 0x0000000000e04669 swift::TypeChecker::typeCheckExpression(swift::Expr*&, swift::DeclContext*, swift::Type, swift::ContextualTypePurpose, swift::OptionSet<swift::TypeCheckExprFlags, unsigned int>, swift::ExprTypeCheckListener*) + 569
15 swift 0x0000000000e057e0 swift::TypeChecker::typeCheckBinding(swift::Pattern*&, swift::Expr*&, swift::DeclContext*) + 112
16 swift 0x0000000000e05989 swift::TypeChecker::typeCheckPatternBinding(swift::PatternBindingDecl*, unsigned int) + 265
18 swift 0x0000000000e1a904 swift::TypeChecker::validateDecl(swift::ValueDecl*, bool) + 3876
19 swift 0x00000000010097dc swift::DeclContext::lookupQualified(swift::Type, swift::DeclName, unsigned int, swift::LazyResolver*, llvm::SmallVectorImpl<swift::ValueDecl*>&) const + 2908
20 swift 0x00000000010081ed swift::UnqualifiedLookup::UnqualifiedLookup(swift::DeclName, swift::DeclContext*, swift::LazyResolver*, bool, swift::SourceLoc, bool, bool) + 2269
21 swift 0x0000000000e40aeb swift::TypeChecker::lookupUnqualified(swift::DeclContext*, swift::DeclName, swift::SourceLoc, swift::OptionSet<swift::NameLookupFlags, unsigned int>) + 187
24 swift 0x0000000000e6a36e 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 0x0000000000e6b274 swift::TypeChecker::resolveType(swift::TypeRepr*, swift::DeclContext*, swift::OptionSet<swift::TypeResolutionFlags, unsigned int>, swift::GenericTypeResolver*, llvm::function_ref<bool (swift::TypeCheckRequest)>*) + 164
27 swift 0x0000000000e6a27a swift::TypeChecker::validateType(swift::TypeLoc&, swift::DeclContext*, swift::OptionSet<swift::TypeResolutionFlags, unsigned int>, swift::GenericTypeResolver*, llvm::function_ref<bool (swift::TypeCheckRequest)>*) + 42
28 swift 0x0000000000e3ce7f swift::TypeChecker::checkGenericParamList(swift::ArchetypeBuilder*, swift::GenericParamList*, swift::DeclContext*, bool, swift::GenericTypeResolver*) + 607
29 swift 0x0000000000e3e5ff swift::TypeChecker::validateGenericSignature(swift::GenericParamList*, swift::DeclContext*, swift::GenericSignature*, std::function<bool (swift::ArchetypeBuilder&)>, bool&) + 143
30 swift 0x0000000000e3e9b4 swift::TypeChecker::validateGenericTypeSignature(swift::NominalTypeDecl*) + 116
31 swift 0x0000000000e19b42 swift::TypeChecker::validateDecl(swift::ValueDecl*, bool) + 354
35 swift 0x0000000000e1f2c6 swift::TypeChecker::typeCheckDecl(swift::Decl*, bool) + 150
36 swift 0x0000000000deb4e2 swift::performTypeChecking(swift::SourceFile&, swift::TopLevelContext&, swift::OptionSet<swift::TypeCheckingFlags, unsigned int>, unsigned int) + 1474
37 swift 0x0000000000ca2572 swift::CompilerInstance::performSema() + 2946
39 swift 0x0000000000764552 frontend_main(llvm::ArrayRef<char const*>, char const*, void*) + 2482
40 swift 0x000000000075f131 main + 2705
Stack dump:
0. Program arguments: /path/to/build/Ninja-ReleaseAssert/swift-linux-x86_64/bin/swift -frontend -c -primary-file validation-test/compiler_crashers/28195-swift-constraints-constraintsystem-resolveoverload.swift -target x86_64-unknown-linux-gnu -disable-objc-interop -module-name main -o /tmp/28195-swift-constraints-constraintsystem-resolveoverload-3b9977.o
1. While type-checking 'a' at validation-test/compiler_crashers/28195-swift-constraints-constraintsystem-resolveoverload.swift:8:1
2. While resolving type h at [validation-test/compiler_crashers/28195-swift-constraints-constraintsystem-resolveoverload.swift:11:16 - line:11:16] RangeText="h"
3. While type-checking expression at [validation-test/compiler_crashers/28195-swift-constraints-constraintsystem-resolveoverload.swift:10:7 - line:10:7] RangeText="b"
<unknown>:0: error: unable to execute command: Aborted
<unknown>:0: error: compile command failed due to signal (use -v to see invocation)
```
2016-01-09 01:41:08 +01:00
practicalswift
6a2fc3ae90
[swiftc] Add test case for crash triggered in swift::AbstractStorageDecl::isGetterMutating() const
...
Stack trace:
```
swift: /path/to/swift/lib/AST/Decl.cpp:2663: bool swift::AbstractStorageDecl::isGetterMutating() const: Assertion `getGetter()' failed.
8 swift 0x0000000000fcd29a swift::AbstractStorageDecl::isGetterMutating() const + 154
13 swift 0x0000000000f72a35 swift::Expr::walk(swift::ASTWalker&) + 69
14 swift 0x0000000000e91d46 swift::constraints::ConstraintSystem::applySolution(swift::constraints::Solution&, swift::Expr*, swift::Type, bool, bool, bool) + 502
15 swift 0x0000000000e046db swift::TypeChecker::typeCheckExpression(swift::Expr*&, swift::DeclContext*, swift::Type, swift::ContextualTypePurpose, swift::OptionSet<swift::TypeCheckExprFlags, unsigned int>, swift::ExprTypeCheckListener*) + 683
19 swift 0x0000000000eacf58 swift::constraints::ConstraintSystem::diagnoseFailureForExpr(swift::Expr*) + 104
20 swift 0x0000000000eb180e swift::constraints::ConstraintSystem::salvage(llvm::SmallVectorImpl<swift::constraints::Solution>&, swift::Expr*) + 4046
21 swift 0x0000000000dfe2d5 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
22 swift 0x0000000000e04669 swift::TypeChecker::typeCheckExpression(swift::Expr*&, swift::DeclContext*, swift::Type, swift::ContextualTypePurpose, swift::OptionSet<swift::TypeCheckExprFlags, unsigned int>, swift::ExprTypeCheckListener*) + 569
25 swift 0x0000000000e64a2a swift::TypeChecker::typeCheckFunctionBodyUntil(swift::FuncDecl*, swift::SourceLoc) + 362
26 swift 0x0000000000e6487e swift::TypeChecker::typeCheckAbstractFunctionBodyUntil(swift::AbstractFunctionDecl*, swift::SourceLoc) + 46
27 swift 0x0000000000e65448 swift::TypeChecker::typeCheckAbstractFunctionBody(swift::AbstractFunctionDecl*) + 136
29 swift 0x0000000000deb60b swift::performTypeChecking(swift::SourceFile&, swift::TopLevelContext&, swift::OptionSet<swift::TypeCheckingFlags, unsigned int>, unsigned int) + 1771
30 swift 0x0000000000ca2572 swift::CompilerInstance::performSema() + 2946
32 swift 0x0000000000764552 frontend_main(llvm::ArrayRef<char const*>, char const*, void*) + 2482
33 swift 0x000000000075f131 main + 2705
Stack dump:
0. Program arguments: /path/to/build/Ninja-ReleaseAssert/swift-linux-x86_64/bin/swift -frontend -c -primary-file validation-test/compiler_crashers/28194-swift-abstractstoragedecl-isgettermutating.swift -target x86_64-unknown-linux-gnu -disable-objc-interop -module-name main -o /tmp/28194-swift-abstractstoragedecl-isgettermutating-e7cbe7.o
1. While type-checking setter for a at validation-test/compiler_crashers/28194-swift-abstractstoragedecl-isgettermutating.swift:9:20
2. While type-checking expression at [validation-test/compiler_crashers/28194-swift-abstractstoragedecl-isgettermutating.swift:9:24 - line:9:25] RangeText="a{"
3. While type-checking expression at [validation-test/compiler_crashers/28194-swift-abstractstoragedecl-isgettermutating.swift:9:24 - line:9:24] 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-01-08 22:06:25 +01:00
Dmitri Gribenko
a121db87eb
Merge pull request #898 from practicalswift/swiftc-28193-swift-typechecker-lookupmembertype
...
[swiftc] Add test case for crash triggered in swift::TypeChecker::lookupMemberType(…)
2016-01-08 22:39:17 +02:00
practicalswift
4ea2138292
Add AddressSanitizer (ASan) output to crash cases.
2016-01-08 20:04:15 +01:00
Jacob Bandes-Storch
8cc8c5cc22
[Sema] Improve handling of invalid protocols during conformance checking
2016-01-08 00:27:24 -08:00
Doug Gregor
1a38e0ad3b
Merge branch 'master' into swift-3-api-guidelines
2016-01-06 15:32:55 -08:00
practicalswift
73cd730dd2
[swiftc] Add test case for crash triggered in swift::TypeChecker::lookupMemberType(swift::DeclContext*, swift::Type, swift::Identifier, swift::OptionSet<swift::NameLookupFlags, unsigned int>)
...
Stack trace:
```
swift: /path/to/swift/lib/Sema/TypeCheckNameLookup.cpp:320: swift::LookupTypeResult swift::TypeChecker::lookupMemberType(swift::DeclContext *, swift::Type, swift::Identifier, NameLookupOptions): Assertion `!type->isTypeParameter()' failed.
8 swift 0x0000000000e3e889 swift::TypeChecker::lookupMemberType(swift::DeclContext*, swift::Type, swift::Identifier, swift::OptionSet<swift::NameLookupFlags, unsigned int>) + 1433
10 swift 0x0000000000dfb061 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>) + 385
11 swift 0x0000000000e01509 swift::TypeChecker::typeCheckExpression(swift::Expr*&, swift::DeclContext*, swift::Type, swift::ContextualTypePurpose, swift::OptionSet<swift::TypeCheckExprFlags, unsigned int>, swift::ExprTypeCheckListener*) + 569
12 swift 0x0000000000e0296c swift::TypeChecker::typeCheckForEachBinding(swift::DeclContext*, swift::ForEachStmt*) + 76
16 swift 0x0000000000e6161a swift::TypeChecker::typeCheckFunctionBodyUntil(swift::FuncDecl*, swift::SourceLoc) + 362
17 swift 0x0000000000e6146e swift::TypeChecker::typeCheckAbstractFunctionBodyUntil(swift::AbstractFunctionDecl*, swift::SourceLoc) + 46
18 swift 0x0000000000e62038 swift::TypeChecker::typeCheckAbstractFunctionBody(swift::AbstractFunctionDecl*) + 136
20 swift 0x0000000000de84ab swift::performTypeChecking(swift::SourceFile&, swift::TopLevelContext&, swift::OptionSet<swift::TypeCheckingFlags, unsigned int>, unsigned int) + 1771
21 swift 0x0000000000c9deb2 swift::CompilerInstance::performSema() + 2946
23 swift 0x0000000000763472 frontend_main(llvm::ArrayRef<char const*>, char const*, void*) + 2482
24 swift 0x000000000075e051 main + 2705
Stack dump:
0. Program arguments: /path/to/build/Ninja-ReleaseAssert/swift-linux-x86_64/bin/swift -frontend -c -primary-file validation-test/compiler_crashers/28193-swift-typechecker-lookupmembertype.swift -target x86_64-unknown-linux-gnu -disable-objc-interop -module-name main -o /tmp/28193-swift-typechecker-lookupmembertype-5af868.o
1. While type-checking getter for d at validation-test/compiler_crashers/28193-swift-typechecker-lookupmembertype.swift:8:21
2. While type-checking expression at [validation-test/compiler_crashers/28193-swift-typechecker-lookupmembertype.swift:8:28 - line:8:28] RangeText="d"
<unknown>:0: error: unable to execute command: Aborted
<unknown>:0: error: compile command failed due to signal (use -v to see invocation)
```
2016-01-06 21:42:23 +01:00
practicalswift
0f81366710
[swiftc] Add test case for crash triggered in swift::GenericFunctionType::get(swift::GenericSignature*, swift::Type, swift::Type, swift::AnyFunctionType::ExtInfo const&)
...
Stack trace:
```
swift: /path/to/swift/lib/AST/ASTContext.cpp:2868: static swift::GenericFunctionType *swift::GenericFunctionType::get(swift::GenericSignature *, swift::Type, swift::Type, const swift::AnyFunctionType::ExtInfo &): Assertion `sig && "no generic signature for generic function type?!"' failed.
8 swift 0x0000000000f3950e swift::GenericFunctionType::get(swift::GenericSignature*, swift::Type, swift::Type, swift::AnyFunctionType::ExtInfo const&) + 574
11 swift 0x0000000000eccae9 swift::TypeChecker::compareDeclarations(swift::DeclContext*, swift::ValueDecl*, swift::ValueDecl*) + 25
14 swift 0x0000000000e465d1 swift::TypeChecker::resolveTypeWitness(swift::NormalProtocolConformance const*, swift::AssociatedTypeDecl*) + 193
15 swift 0x000000000100e216 swift::NormalProtocolConformance::getTypeWitnessSubstAndDecl(swift::AssociatedTypeDecl*, swift::LazyResolver*) const + 150
16 swift 0x000000000100e158 swift::ProtocolConformance::getTypeWitnessSubstAndDecl(swift::AssociatedTypeDecl*, swift::LazyResolver*) const + 40
17 swift 0x000000000100e8f6 swift::ProtocolConformance::getTypeWitness(swift::AssociatedTypeDecl*, swift::LazyResolver*) const + 6
20 swift 0x000000000101e0ec swift::Type::transform(std::function<swift::Type (swift::Type)> const&) const + 44
21 swift 0x00000000010174ef 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
22 swift 0x0000000000e3b838 swift::TypeChecker::checkGenericArguments(swift::DeclContext*, swift::SourceLoc, swift::SourceLoc, swift::Type, swift::GenericSignature*, llvm::ArrayRef<swift::Type>) + 408
23 swift 0x0000000000e461a7 swift::TypeChecker::checkConformance(swift::NormalProtocolConformance*) + 1399
29 swift 0x0000000000e1c0c6 swift::TypeChecker::typeCheckDecl(swift::Decl*, bool) + 150
32 swift 0x0000000000e628fa swift::TypeChecker::typeCheckClosureBody(swift::ClosureExpr*) + 218
33 swift 0x0000000000e8e98c swift::constraints::ConstraintSystem::applySolution(swift::constraints::Solution&, swift::Expr*, swift::Type, bool, bool, bool) + 812
34 swift 0x0000000000e0157b swift::TypeChecker::typeCheckExpression(swift::Expr*&, swift::DeclContext*, swift::Type, swift::ContextualTypePurpose, swift::OptionSet<swift::TypeCheckExprFlags, unsigned int>, swift::ExprTypeCheckListener*) + 683
36 swift 0x0000000000e62a46 swift::TypeChecker::typeCheckTopLevelCodeDecl(swift::TopLevelCodeDecl*) + 134
37 swift 0x0000000000de83ed swift::performTypeChecking(swift::SourceFile&, swift::TopLevelContext&, swift::OptionSet<swift::TypeCheckingFlags, unsigned int>, unsigned int) + 1581
38 swift 0x0000000000c9deb2 swift::CompilerInstance::performSema() + 2946
40 swift 0x0000000000763472 frontend_main(llvm::ArrayRef<char const*>, char const*, void*) + 2482
41 swift 0x000000000075e051 main + 2705
Stack dump:
0. Program arguments: /path/to/build/Ninja-ReleaseAssert/swift-linux-x86_64/bin/swift -frontend -c -primary-file validation-test/compiler_crashers/28192-swift-genericfunctiontype-get.swift -target x86_64-unknown-linux-gnu -disable-objc-interop -module-name main -o /tmp/28192-swift-genericfunctiontype-get-81d34c.o
1. While type-checking expression at [validation-test/compiler_crashers/28192-swift-genericfunctiontype-get.swift:8:1 - line:8:64] RangeText="{struct Q<I{struct A:OptionSetType{let rawValue=""let rawValue=0"
2. While type-checking 'Q' at validation-test/compiler_crashers/28192-swift-genericfunctiontype-get.swift:8:2
<unknown>:0: error: unable to execute command: Aborted
<unknown>:0: error: compile command failed due to signal (use -v to see invocation)
```
2016-01-06 13:54:17 +01:00
Dmitri Gribenko
54dcd16759
Merge pull request #876 from practicalswift/swiftc-28191-swift-typebase-getcanonicaltype
...
[swiftc] Add test case for crash triggered in swift::TypeBase::getCanonicalType()
2016-01-06 12:00:47 +02:00
Dmitri Gribenko
dcc163842e
Merge pull request #859 from practicalswift/swiftc-28189-swift-valuedecl-settype
...
[swiftc] Add test case for crash triggered in swift::ValueDecl::setType(…)
2016-01-06 12:00:33 +02:00
Dmitri Gribenko
e56345b69f
Merge pull request #866 from practicalswift/swiftc-28190-swift-conformancelookuptable-expandimpliedconformances
...
[swiftc] Add test case for crash triggered in swift::ConformanceLookupTable::expandImpliedConformances(…)
2016-01-06 11:59:34 +02:00
Chris Willmore
589a46f9ba
Merge pull request #858 from jder/vararg-tuple-conversion-for-args-only
...
[SR-433][Sema] Don't produce vararg tuples outside of arglists
2016-01-05 17:39:17 -08:00
practicalswift
747a6ebfe3
Add crash type annotations and Valgrind output for memory errors.
...
Valgrind output:
```
$ valgrind swift -frontend -c validation-test/compiler_crashers/16694-swift-constraints-constraintsystem-opentype.swift
Invalid read of size 4
at 0x1016C00: swift::TypeBase::getDesugaredType() (in /path/to/swift/bin/swift)
$ valgrind swift -frontend -c validation-test/compiler_crashers/24394-swift-typevariabletype-implementation-getrepresentative.swift
Invalid read of size 8
at 0x10121C4: swift::TypeBase::getCanonicalType() (in /path/to/swift/bin/swift)
$ valgrind swift -frontend -c validation-test/compiler_crashers/25458-swift-archetypetype-getnestedtype.swift
Invalid read of size 8
at 0xE52866: (anonymous namespace)::ConformanceChecker::recordTypeWitness(swift::AssociatedTypeDecl*, swift::Type, swift::TypeDecl*, swift::DeclContext*, bool, bool) (in /path/to/swift/bin/swift)
$ valgrind swift -frontend -c validation-test/compiler_crashers/27203-swift-typeloc-iserror.swift
Invalid read of size 4
at 0xE42CD5: swift::TypeChecker::checkConformance(swift::NormalProtocolConformance*) (in /path/to/swift/bin/swift)
$ valgrind swift -frontend -c validation-test/compiler_crashers/27443-matchwitness.swift
Invalid read of size 8
at 0xE4BAD1: checkMutating(swift::FuncDecl*, swift::FuncDecl*, swift::ValueDecl*) (in /path/to/swift/bin/swift)
$ valgrind swift -frontend -c validation-test/compiler_crashers/27754-swift-typechecker-resolvetypeincontext.swift
Invalid read of size 8
at 0x10121C4: swift::TypeBase::getCanonicalType() (in /path/to/swift/bin/swift)
$ valgrind swift -frontend -c validation-test/compiler_crashers/28155-swift-typechecker-validategenericfuncsignature.swift
Invalid read of size 2
at 0xF35D76: swift::FunctionType::get(swift::Type, swift::Type, swift::AnyFunctionType::ExtInfo const&) (in /path/to/swift/bin/swift)
```
2016-01-05 14:23:06 +01:00
practicalswift
53042baa41
[swiftc] Add test case for crash triggered in swift::TypeBase::getCanonicalType()
...
Stack trace:
```
4 swift 0x0000000001013ef4 swift::TypeBase::getCanonicalType() + 20
5 swift 0x0000000000e13176 swift::TypeChecker::checkInheritanceClause(swift::Decl*, swift::GenericTypeResolver*) + 5078
6 swift 0x0000000000e15649 swift::TypeChecker::validateDecl(swift::ValueDecl*, bool) + 1833
7 swift 0x00000000010048dc swift::DeclContext::lookupQualified(swift::Type, swift::DeclName, unsigned int, swift::LazyResolver*, llvm::SmallVectorImpl<swift::ValueDecl*>&) const + 2908
8 swift 0x00000000010032ed swift::UnqualifiedLookup::UnqualifiedLookup(swift::DeclName, swift::DeclContext*, swift::LazyResolver*, bool, swift::SourceLoc, bool, bool) + 2269
9 swift 0x0000000000e3bf0b swift::TypeChecker::lookupUnqualified(swift::DeclContext*, swift::DeclName, swift::SourceLoc, swift::OptionSet<swift::NameLookupFlags, unsigned int>) + 187
12 swift 0x0000000000e6593e 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 0x0000000000e66844 swift::TypeChecker::resolveType(swift::TypeRepr*, swift::DeclContext*, swift::OptionSet<swift::TypeResolutionFlags, unsigned int>, swift::GenericTypeResolver*, llvm::function_ref<bool (swift::TypeCheckRequest)>*) + 164
15 swift 0x0000000000e6584a swift::TypeChecker::validateType(swift::TypeLoc&, swift::DeclContext*, swift::OptionSet<swift::TypeResolutionFlags, unsigned int>, swift::GenericTypeResolver*, llvm::function_ref<bool (swift::TypeCheckRequest)>*) + 42
17 swift 0x0000000000e385dc swift::TypeChecker::validateGenericFuncSignature(swift::AbstractFunctionDecl*) + 124
22 swift 0x0000000000e16671 swift::TypeChecker::validateDecl(swift::ValueDecl*, bool) + 5969
23 swift 0x00000000010048dc swift::DeclContext::lookupQualified(swift::Type, swift::DeclName, unsigned int, swift::LazyResolver*, llvm::SmallVectorImpl<swift::ValueDecl*>&) const + 2908
24 swift 0x0000000000e3cbba swift::TypeChecker::lookupMemberType(swift::DeclContext*, swift::Type, swift::Identifier, swift::OptionSet<swift::NameLookupFlags, unsigned int>) + 282
26 swift 0x0000000000e6593e swift::TypeChecker::resolveIdentifierType(swift::DeclContext*, swift::IdentTypeRepr*, swift::OptionSet<swift::TypeResolutionFlags, unsigned int>, bool, swift::GenericTypeResolver*, llvm::function_ref<bool (swift::TypeCheckRequest)>*) + 158
28 swift 0x0000000000e66844 swift::TypeChecker::resolveType(swift::TypeRepr*, swift::DeclContext*, swift::OptionSet<swift::TypeResolutionFlags, unsigned int>, swift::GenericTypeResolver*, llvm::function_ref<bool (swift::TypeCheckRequest)>*) + 164
29 swift 0x0000000000e6584a swift::TypeChecker::validateType(swift::TypeLoc&, swift::DeclContext*, swift::OptionSet<swift::TypeResolutionFlags, unsigned int>, swift::GenericTypeResolver*, llvm::function_ref<bool (swift::TypeCheckRequest)>*) + 42
30 swift 0x0000000000ef58d2 swift::IterativeTypeChecker::processResolveInheritedClauseEntry(std::pair<llvm::PointerUnion<swift::TypeDecl*, swift::ExtensionDecl*>, unsigned int>, llvm::function_ref<bool (swift::TypeCheckRequest)>) + 146
31 swift 0x0000000000ef4b5d swift::IterativeTypeChecker::satisfy(swift::TypeCheckRequest) + 493
32 swift 0x0000000000ef4ce9 swift::IterativeTypeChecker::satisfy(swift::TypeCheckRequest) + 889
33 swift 0x0000000000e11cb0 swift::TypeChecker::resolveInheritedProtocols(swift::ProtocolDecl*) + 64
34 swift 0x0000000000f1f191 swift::ArchetypeBuilder::addConformanceRequirement(swift::ArchetypeBuilder::PotentialArchetype*, swift::ProtocolDecl*, swift::RequirementSource, llvm::SmallPtrSetImpl<swift::ProtocolDecl*>&) + 225
37 swift 0x0000000000f20aaf swift::ArchetypeBuilder::visitInherited(llvm::ArrayRef<swift::TypeLoc>, llvm::function_ref<bool (swift::Type, swift::SourceLoc)>) + 175
38 swift 0x0000000000f1eefb swift::ArchetypeBuilder::addAbstractTypeParamRequirements(swift::AbstractTypeParamDecl*, swift::ArchetypeBuilder::PotentialArchetype*, swift::RequirementSource::Kind, llvm::SmallPtrSetImpl<swift::ProtocolDecl*>&) + 603
39 swift 0x0000000000f1f2b7 swift::ArchetypeBuilder::addConformanceRequirement(swift::ArchetypeBuilder::PotentialArchetype*, swift::ProtocolDecl*, swift::RequirementSource, llvm::SmallPtrSetImpl<swift::ProtocolDecl*>&) + 519
42 swift 0x0000000000f20aaf swift::ArchetypeBuilder::visitInherited(llvm::ArrayRef<swift::TypeLoc>, llvm::function_ref<bool (swift::Type, swift::SourceLoc)>) + 175
43 swift 0x0000000000f1eefb swift::ArchetypeBuilder::addAbstractTypeParamRequirements(swift::AbstractTypeParamDecl*, swift::ArchetypeBuilder::PotentialArchetype*, swift::RequirementSource::Kind, llvm::SmallPtrSetImpl<swift::ProtocolDecl*>&) + 603
44 swift 0x0000000000f1ec7c swift::ArchetypeBuilder::addGenericParameterRequirements(swift::GenericTypeParamDecl*) + 172
45 swift 0x0000000000e381c7 swift::TypeChecker::checkGenericParamList(swift::ArchetypeBuilder*, swift::GenericParamList*, swift::DeclContext*, bool, swift::GenericTypeResolver*) + 391
46 swift 0x0000000000e39a1f swift::TypeChecker::validateGenericSignature(swift::GenericParamList*, swift::DeclContext*, swift::GenericSignature*, std::function<bool (swift::ArchetypeBuilder&)>, bool&) + 143
47 swift 0x0000000000e39dd4 swift::TypeChecker::validateGenericTypeSignature(swift::NominalTypeDecl*) + 116
48 swift 0x0000000000e15400 swift::TypeChecker::validateDecl(swift::ValueDecl*, bool) + 1248
53 swift 0x0000000000e6593e swift::TypeChecker::resolveIdentifierType(swift::DeclContext*, swift::IdentTypeRepr*, swift::OptionSet<swift::TypeResolutionFlags, unsigned int>, bool, swift::GenericTypeResolver*, llvm::function_ref<bool (swift::TypeCheckRequest)>*) + 158
55 swift 0x0000000000e66844 swift::TypeChecker::resolveType(swift::TypeRepr*, swift::DeclContext*, swift::OptionSet<swift::TypeResolutionFlags, unsigned int>, swift::GenericTypeResolver*, llvm::function_ref<bool (swift::TypeCheckRequest)>*) + 164
56 swift 0x0000000000e6584a swift::TypeChecker::validateType(swift::TypeLoc&, swift::DeclContext*, swift::OptionSet<swift::TypeResolutionFlags, unsigned int>, swift::GenericTypeResolver*, llvm::function_ref<bool (swift::TypeCheckRequest)>*) + 42
57 swift 0x0000000000ef58d2 swift::IterativeTypeChecker::processResolveInheritedClauseEntry(std::pair<llvm::PointerUnion<swift::TypeDecl*, swift::ExtensionDecl*>, unsigned int>, llvm::function_ref<bool (swift::TypeCheckRequest)>) + 146
58 swift 0x0000000000ef4b5d swift::IterativeTypeChecker::satisfy(swift::TypeCheckRequest) + 493
59 swift 0x0000000000ef4ce9 swift::IterativeTypeChecker::satisfy(swift::TypeCheckRequest) + 889
60 swift 0x0000000000e11cb0 swift::TypeChecker::resolveInheritedProtocols(swift::ProtocolDecl*) + 64
61 swift 0x0000000000f1f191 swift::ArchetypeBuilder::addConformanceRequirement(swift::ArchetypeBuilder::PotentialArchetype*, swift::ProtocolDecl*, swift::RequirementSource, llvm::SmallPtrSetImpl<swift::ProtocolDecl*>&) + 225
64 swift 0x0000000000f20aaf swift::ArchetypeBuilder::visitInherited(llvm::ArrayRef<swift::TypeLoc>, llvm::function_ref<bool (swift::Type, swift::SourceLoc)>) + 175
65 swift 0x0000000000f1eefb swift::ArchetypeBuilder::addAbstractTypeParamRequirements(swift::AbstractTypeParamDecl*, swift::ArchetypeBuilder::PotentialArchetype*, swift::RequirementSource::Kind, llvm::SmallPtrSetImpl<swift::ProtocolDecl*>&) + 603
66 swift 0x0000000000f1ec7c swift::ArchetypeBuilder::addGenericParameterRequirements(swift::GenericTypeParamDecl*) + 172
67 swift 0x0000000000e381c7 swift::TypeChecker::checkGenericParamList(swift::ArchetypeBuilder*, swift::GenericParamList*, swift::DeclContext*, bool, swift::GenericTypeResolver*) + 391
68 swift 0x0000000000e39a1f swift::TypeChecker::validateGenericSignature(swift::GenericParamList*, swift::DeclContext*, swift::GenericSignature*, std::function<bool (swift::ArchetypeBuilder&)>, bool&) + 143
69 swift 0x0000000000e39dd4 swift::TypeChecker::validateGenericTypeSignature(swift::NominalTypeDecl*) + 116
70 swift 0x0000000000e15400 swift::TypeChecker::validateDecl(swift::ValueDecl*, bool) + 1248
73 swift 0x0000000000e1a816 swift::TypeChecker::typeCheckDecl(swift::Decl*, bool) + 150
74 swift 0x0000000000de6ab2 swift::performTypeChecking(swift::SourceFile&, swift::TopLevelContext&, swift::OptionSet<swift::TypeCheckingFlags, unsigned int>, unsigned int) + 1474
75 swift 0x0000000000c9c702 swift::CompilerInstance::performSema() + 2946
77 swift 0x0000000000763402 frontend_main(llvm::ArrayRef<char const*>, char const*, void*) + 2482
78 swift 0x000000000075dfe1 main + 2705
Stack dump:
0. Program arguments: /path/to/build/Ninja-ReleaseAssert/swift-linux-x86_64/bin/swift -frontend -c -primary-file validation-test/compiler_crashers/28191-swift-typebase-getcanonicaltype.swift -target x86_64-unknown-linux-gnu -disable-objc-interop -module-name main -o /tmp/28191-swift-typebase-getcanonicaltype-ad7dcd.o
1. While type-checking 'a' at validation-test/compiler_crashers/28191-swift-typebase-getcanonicaltype.swift:7:1
2. While resolving type A.e at [validation-test/compiler_crashers/28191-swift-typebase-getcanonicaltype.swift:7:12 - line:7:14] RangeText="A.e"
3. While resolving type A.e at [validation-test/compiler_crashers/28191-swift-typebase-getcanonicaltype.swift:7:12 - line:7:14] RangeText="A.e"
4. While type-checking 'A' at validation-test/compiler_crashers/28191-swift-typebase-getcanonicaltype.swift:8:1
5. While resolving type A at [validation-test/compiler_crashers/28191-swift-typebase-getcanonicaltype.swift:10:8 - line:10:8] RangeText="A"
<unknown>:0: error: unable to execute command: Segmentation fault
<unknown>:0: error: compile command failed due to signal (use -v to see invocation)
```
2016-01-04 23:32:55 +01:00
Max Moiseev
f51e708a8f
Merge remote-tracking branch 'origin/master' into swift-3-api-guidelines
2016-01-04 12:25:25 -08:00
practicalswift
8482b5954c
[swiftc] Add test case for crash triggered in swift::ConformanceLookupTable::expandImpliedConformances(swift::NominalTypeDecl*, swift::DeclContext*, swift::LazyResolver*)
...
Stack trace:
```
swift: /path/to/swift/lib/AST/ConformanceLookupTable.cpp:497: void swift::ConformanceLookupTable::expandImpliedConformances(swift::NominalTypeDecl *, swift::DeclContext *, swift::LazyResolver *): Assertion `i <= 16384 && "Infinite loop due to circular protocol inheritance?"' failed.
8 swift 0x0000000001044d15 swift::ConformanceLookupTable::expandImpliedConformances(swift::NominalTypeDecl*, swift::DeclContext*, swift::LazyResolver*) + 821
9 swift 0x0000000001042f15 swift::ConformanceLookupTable::updateLookupTable(swift::NominalTypeDecl*, swift::ConformanceLookupTable::ConformanceStage, swift::LazyResolver*) + 1109
10 swift 0x000000000104655e swift::ConformanceLookupTable::getAllProtocols(swift::NominalTypeDecl*, swift::LazyResolver*, llvm::SmallVectorImpl<swift::ProtocolDecl*>&) + 30
11 swift 0x000000000100f67f swift::NominalTypeDecl::getAllProtocols() const + 95
12 swift 0x0000000001004b49 swift::DeclContext::lookupQualified(swift::Type, swift::DeclName, unsigned int, swift::LazyResolver*, llvm::SmallVectorImpl<swift::ValueDecl*>&) const + 3529
13 swift 0x00000000010032ed swift::UnqualifiedLookup::UnqualifiedLookup(swift::DeclName, swift::DeclContext*, swift::LazyResolver*, bool, swift::SourceLoc, bool, bool) + 2269
14 swift 0x0000000000e3bf0b swift::TypeChecker::lookupUnqualified(swift::DeclContext*, swift::DeclName, swift::SourceLoc, swift::OptionSet<swift::NameLookupFlags, unsigned int>) + 187
15 swift 0x0000000000df81e8 swift::TypeChecker::resolveDeclRefExpr(swift::UnresolvedDeclRefExpr*, swift::DeclContext*) + 120
17 swift 0x0000000000f6dd83 swift::Expr::walk(swift::ASTWalker&) + 19
18 swift 0x0000000000df9697 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
19 swift 0x0000000000dffc49 swift::TypeChecker::typeCheckExpression(swift::Expr*&, swift::DeclContext*, swift::Type, swift::ContextualTypePurpose, swift::OptionSet<swift::TypeCheckExprFlags, unsigned int>, swift::ExprTypeCheckListener*) + 569
20 swift 0x0000000000e00d60 swift::TypeChecker::typeCheckBinding(swift::Pattern*&, swift::Expr*&, swift::DeclContext*) + 112
21 swift 0x0000000000e00f09 swift::TypeChecker::typeCheckPatternBinding(swift::PatternBindingDecl*, unsigned int) + 265
26 swift 0x0000000000e1a816 swift::TypeChecker::typeCheckDecl(swift::Decl*, bool) + 150
27 swift 0x0000000000de6ab2 swift::performTypeChecking(swift::SourceFile&, swift::TopLevelContext&, swift::OptionSet<swift::TypeCheckingFlags, unsigned int>, unsigned int) + 1474
28 swift 0x0000000000c9c702 swift::CompilerInstance::performSema() + 2946
30 swift 0x0000000000763402 frontend_main(llvm::ArrayRef<char const*>, char const*, void*) + 2482
31 swift 0x000000000075dfe1 main + 2705
Stack dump:
0. Program arguments: /path/to/build/Ninja-ReleaseAssert/swift-linux-x86_64/bin/swift -frontend -c -primary-file validation-test/compiler_crashers/28190-swift-conformancelookuptable-expandimpliedconformances.swift -target x86_64-unknown-linux-gnu -disable-objc-interop -module-name main -o /tmp/28190-swift-conformancelookuptable-expandimpliedconformances-582f15.o
1. While type-checking 'c' at validation-test/compiler_crashers/28190-swift-conformancelookuptable-expandimpliedconformances.swift:10:1
2. While type-checking expression at [validation-test/compiler_crashers/28190-swift-conformancelookuptable-expandimpliedconformances.swift:11:7 - line:11: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)
```
2016-01-04 02:55:10 +01:00
practicalswift
66b4481fc0
[swiftc] Add test case for crash triggered in swift::ValueDecl::setType(swift::Type)
...
Stack trace:
```
validation-test/compiler_crashers/28189-swift-valuedecl-settype.swift:8:7: error: expected '(' in argument list of function declaration
func f{{for b{}{String($0
^
validation-test/compiler_crashers/28189-swift-valuedecl-settype.swift:8:16: error: expected ';' in 'for' statement
func f{{for b{}{String($0
^
validation-test/compiler_crashers/28189-swift-valuedecl-settype.swift:8:26: error: expected ',' separator
func f{{for b{}{String($0
^
,
validation-test/compiler_crashers/28189-swift-valuedecl-settype.swift:9:1: error: expected expression in list of expressions
^
validation-test/compiler_crashers/28189-swift-valuedecl-settype.swift:8:26: error: expected ',' separator
func f{{for b{}{String($0
^
,
validation-test/compiler_crashers/28189-swift-valuedecl-settype.swift:9:1: error: expected '}' at end of closure
^
validation-test/compiler_crashers/28189-swift-valuedecl-settype.swift:8:16: note: to match this opening '{'
func f{{for b{}{String($0
^
validation-test/compiler_crashers/28189-swift-valuedecl-settype.swift:8:26: error: expected ';' in 'for' statement
func f{{for b{}{String($0
^
validation-test/compiler_crashers/28189-swift-valuedecl-settype.swift:9:1: error: expected expression
^
validation-test/compiler_crashers/28189-swift-valuedecl-settype.swift:9:1: error: expected '{' in 'for' statement
^
validation-test/compiler_crashers/28189-swift-valuedecl-settype.swift:9:1: error: expected '}' at end of closure
^
validation-test/compiler_crashers/28189-swift-valuedecl-settype.swift:8:8: note: to match this opening '{'
func f{{for b{}{String($0
^
validation-test/compiler_crashers/28189-swift-valuedecl-settype.swift:8:8: error: braced block of statements is an unused closure
func f{{for b{}{String($0
^
validation-test/compiler_crashers/28189-swift-valuedecl-settype.swift:9:1: error: expected '}' at end of brace statement
^
validation-test/compiler_crashers/28189-swift-valuedecl-settype.swift:8:7: note: to match this opening '{'
func f{{for b{}{String($0
^
validation-test/compiler_crashers/28189-swift-valuedecl-settype.swift:8:13: error: use of unresolved identifier 'b'
func f{{for b{}{String($0
^
swift: /path/to/swift/lib/AST/Decl.cpp:1728: void swift::ValueDecl::setType(swift::Type): Assertion `!hasType() && "changing type of declaration"' failed.
8 swift 0x0000000000fc370c swift::ValueDecl::setType(swift::Type) + 92
10 swift 0x0000000000ea80d9 swift::constraints::ConstraintSystem::diagnoseFailureForExpr(swift::Expr*) + 6649
11 swift 0x0000000000eaaffe swift::constraints::ConstraintSystem::salvage(llvm::SmallVectorImpl<swift::constraints::Solution>&, swift::Expr*) + 4046
12 swift 0x0000000000df7c55 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
13 swift 0x0000000000dfdfe9 swift::TypeChecker::typeCheckExpression(swift::Expr*&, swift::DeclContext*, swift::Type, swift::ContextualTypePurpose, swift::OptionSet<swift::TypeCheckExprFlags, unsigned int>, swift::ExprTypeCheckListener*) + 569
14 swift 0x0000000000dffbc1 swift::TypeChecker::typeCheckCondition(swift::Expr*&, swift::DeclContext*) + 145
18 swift 0x0000000000e5f29a swift::TypeChecker::typeCheckClosureBody(swift::ClosureExpr*) + 218
19 swift 0x0000000000e8b85c swift::constraints::ConstraintSystem::applySolution(swift::constraints::Solution&, swift::Expr*, swift::Type, bool, bool, bool) + 812
20 swift 0x0000000000dfe05b swift::TypeChecker::typeCheckExpression(swift::Expr*&, swift::DeclContext*, swift::Type, swift::ContextualTypePurpose, swift::OptionSet<swift::TypeCheckExprFlags, unsigned int>, swift::ExprTypeCheckListener*) + 683
23 swift 0x0000000000e5dfaa swift::TypeChecker::typeCheckFunctionBodyUntil(swift::FuncDecl*, swift::SourceLoc) + 362
24 swift 0x0000000000e5ddfe swift::TypeChecker::typeCheckAbstractFunctionBodyUntil(swift::AbstractFunctionDecl*, swift::SourceLoc) + 46
25 swift 0x0000000000e5e9d8 swift::TypeChecker::typeCheckAbstractFunctionBody(swift::AbstractFunctionDecl*) + 136
27 swift 0x0000000000de4f7b swift::performTypeChecking(swift::SourceFile&, swift::TopLevelContext&, swift::OptionSet<swift::TypeCheckingFlags, unsigned int>, unsigned int) + 1771
28 swift 0x0000000000c9ab42 swift::CompilerInstance::performSema() + 2946
30 swift 0x00000000007631e2 frontend_main(llvm::ArrayRef<char const*>, char const*, void*) + 2482
31 swift 0x000000000075ddc1 main + 2705
Stack dump:
0. Program arguments: /usr/local/bin/swift/bin/swift -frontend -c -primary-file validation-test/compiler_crashers/28189-swift-valuedecl-settype.swift -target x86_64-unknown-linux-gnu -disable-objc-interop -module-name main -o /tmp/28189-swift-valuedecl-settype-5823eb.o
1. While type-checking 'f' at validation-test/compiler_crashers/28189-swift-valuedecl-settype.swift:8:1
2. While type-checking expression at [validation-test/compiler_crashers/28189-swift-valuedecl-settype.swift:8:8 - line:8:24] RangeText="{for b{}{String($"
3. While type-checking expression at [validation-test/compiler_crashers/28189-swift-valuedecl-settype.swift:8:16 - line:8:24] RangeText="{String($"
<unknown>:0: error: unable to execute command: Aborted
<unknown>:0: error: compile command failed due to signal (use -v to see invocation)
```
2016-01-03 01:15:27 +01:00
Jesse Rusak
63faeac77c
[SR-433][Sema] Don't produce vararg tuples outside of arglists
...
Previously, we could produce such a tuple shuffle for non-arg
tuples, which would trigger an assert in SILGen.
2016-01-02 15:37:42 -05:00
Chris Lattner
af8d51dabe
Merge pull request #822 from practicalswift/circular-protocol-inheritance
...
[swiftc] Add assertion: Avoid endless loop in case of circular protocol inheritance
2016-01-01 11:18:42 -08:00
Chris Lattner
c11cbfb88c
Merge pull request #827 from practicalswift/circular-class-inheritance
...
[swiftc] Add assertion: Avoid endless loop in case of circular class inheritance
2016-01-01 11:17:45 -08:00
Chris Lattner
5ce3de8dd6
remove & dial back three old bits of syntax auto-upgrading support:
...
1. Array type parsing for postfix array types Int[]. We now handle this
in the parser, but remove the AST representation of this old form. We
also stop making vague promises about the future by saying that "fixed
size arrays aren't supported... yet". Removal of this fixes a compiler
crasher too.
2. Remove the special case support for migrating @autoclosure from types
to parameters, which was Swift 1.0/1.1 syntax. The world has moved or
we don't care anymore.
3. Remove upgrade support for # arguments (nee "backtick" arguments), which
was a Swift 1.x'ism abolished in an effort to simplify method naming
rules.
NFC on valid code.
2015-12-31 22:29:39 -08:00
practicalswift
97ef0a8b22
Sync with https://github.com/practicalswift/swift-compiler-crashes
...
Add 1 compiler crash (now an assertion failure, previously a hang).
2015-12-31 15:03:53 +01:00
practicalswift
5bbd02b996
Sync with https://github.com/practicalswift/swift-compiler-crashes
...
Add 1 compiler crash (now an assertion failure, previously a hang).
2015-12-31 05:23:01 +01:00
Dmitri Gribenko
a672828589
Annotate a crash test that depends on AppKit
2015-12-28 02:32:57 -08:00
practicalswift
48c40de31e
Sync with https://github.com/practicalswift/swift-compiler-crashes
...
Add 2 compiler crashes (+ 1 fixed crash).
2015-12-27 19:35:50 +01:00
Max Moiseev
a7339e67ac
Merge remote-tracking branch 'origin' into swift-3-api-guidelines
2015-12-22 11:36:07 -08:00
Dmitri Gribenko
b6d4abd42c
Merge pull request #555 from practicalswift/memory-corruption-regression
...
Add 16694-swift-constraints-constraintsystem-opentype.swift as a regression (possible memory corruption)
2015-12-21 22:55:28 -08:00
Doug Gregor
cd1c106e35
Merge remote-tracking branch 'origin/master' into swift-3-api-guidelines
2015-12-18 15:45:48 -08:00
Doug Gregor
3ba3bd359b
Merge pull request #620 from jtbandes/member-fix
...
More error checking for member type lookup
2015-12-18 10:49:06 -08:00
Doug Gregor
a97ab6dd14
Merge remote-tracking branch 'origin/master' into swift-3-api-guidelines
2015-12-18 10:15:47 -08:00
Max Moiseev
3fe0c60d7f
Merge remote-tracking branch 'origin/master' into swift-3-api-guidelines
2015-12-17 11:00:02 -08:00
Jacob Bandes-Storch
ac95c1318f
More error checking for member type lookup
2015-12-17 01:50:53 -08:00
Jacob Bandes-Storch
37207165f0
More error checking for subscript decls
2015-12-17 00:40:01 -08:00
Slava Pestov
d6ea5d8717
Sema: Chain all generic parameter lists
...
Previously, methods on DeclContext for getting generic parameters
and signatures did not walk up from type contexts to function
contexts, or function contexts to function contexts.
Presumably this is because SIL doesn't completely support nested
generics yet, instead only handling these two special cases:
- non-generic local function inside generic function
- generic method inside generic type
For local functions nested inside generic functions, SIL expects
the closure to not have an interface type or generic signature,
even if the contextual type signature contains archetypes.
This should probably be revisited some day.
Recall that these cases are explicitly rejected by Sema diagnostics
because they lack SIL support:
- generic function inside generic function
- generic type inside generic function
After the previous patches in this series, it becomes possible to
construct types that are the same as before for the supported uses of
nested generics, while introducing a more self-consistent conceptual
model for the unsupported cases.
Some new tests show we generate diagnotics in various cases that
used to crash.
The conceptual model might still not be completely right, and of
course SIL, IRGen and runtime support is still missing.
2015-12-16 11:32:56 -08:00
Max Moiseev
2021dd5a4d
Merge remote-tracking branch 'origin/master' into swift-3-api-guidelines
2015-12-15 12:49:22 -08:00
practicalswift
14372cd660
Add 16694-swift-constraints-constraintsystem-opentype.swift as a regression (possible memory corruption).
...
History:
* Marked as fixed in the swift-compiler-crashes project in February 2015 - does not crash Xcode 6.3 beta with Swift 1.2 (6D520o).
* Re-opened as regression in December 2015 - crashes Swift version 2.2-dev (LLVM 7bae82deaa, Clang 53d04af5ce, Swift 56a62b7eef ).
Possible memory corruption:
dmesg:
swift[10043]: segfault at 8 ip 000000000100e5f0 sp 00007ffca9045200 error 4 in swift[400000+3d82000]
valgrind:
==18826== Process terminating with default action of signal 11 (SIGSEGV)
==18826== Access not within mapped region at address 0x8
==18826== at 0x100E5F0: swift::TypeBase::getDesugaredType() (in /path/to/swift/bin/swift)
2015-12-15 09:56:12 +01:00
Slava Pestov
57dfb45ba6
Sema: Add DeclContext::isGenericTypeContext()
...
Once nested generic parameter lists are properly chained, we need a
way of checking if we're inside a generic type context that's
distinct from just checking if we have a generic type signature
available.
This distinguishes between these two cases:
class A<T> {
// generic signature
func method() -> T { // <T> A<T> -> () -> T
}
}
func f<T>() {
class A {
// no generic signature
func method() -> T { // A -> () -> T
}
}
}
2015-12-14 13:46:45 -08:00
Slava Pestov
c258f991f6
Sema: Nuke NominalTypeDecl::markInvalidGenericSignature()
...
This would just set the NominalTypeDecl's declared type to
ErrorType, which caused problems elsewhere.
Instead, generalize the logic used for AbstractFunctionDecl.
This correctly wires up the GenericTypeParamDecl's archetypes even
if the signature didn't validate, fixing crashes if the generic
parameters of the type are referenced.
2015-12-14 13:29:55 -08:00
Slava Pestov
d56cbfaaf9
Sema: Check generic parameter inheritance clause after creating archetype
...
This fixes a crash with invalid code where the inheritance clause
refers back to itself, eg struct E<F : F.A> {}.
2015-12-14 13:29:52 -08:00
Max Moiseev
806be29941
Merge remote-tracking branch 'origin' into swift-3-api-guidelines
2015-12-14 12:05:35 -08:00
Jacob Bandes-Storch
1b142ed054
Add missing setIsParseError() during enum case parsing
...
An invalid `case` construct would incorrectly return a successful status, causing `parseDecl` to crash later when it assumed there were valid decls in the `Entries` vector.
2015-12-13 13:11:22 -08:00
Chris Lattner
d12b5d0666
Merge pull request #421 from practicalswift/less-exotic-swift-frontend-arguments
...
Compiler crashers: Use canonical "-emit-silgen" to trigger crash case.
2015-12-12 15:11:25 -08:00
Max Moiseev
a1c05e6c95
fixing post-merge failures
2015-12-11 15:55:02 -08:00
Max Moiseev
786e1ea2b1
Merge remote-tracking branch 'origin' into swift-3-api-guidelines
2015-12-11 15:19:02 -08:00
Dmitri Gribenko
06d6dab133
Merge pull request #438 from practicalswift/sync-with-swift-compiler-crashes-20151211
...
Sync with https://github.com/practicalswift/swift-compiler-crashes
2015-12-11 14:42:05 -08:00
Doug Gregor
851f2eaf60
Merge pull request #272 from jtbandes/fix3
...
[AST] Improve ErrorType handling in TypeBase::getMemberSubstitutions()
2015-12-11 13:55:59 -08:00
Doug Gregor
53b1503a78
Merge pull request #253 from jtbandes/master
...
Fix crash in `DependentGenericTypeResolver::resolveDependentMemberType`
2015-12-11 13:53:01 -08:00