Arnold Schwaighofer
67e3d27fd9
Copy-on-write existential performance work ( #8369 )
...
* IRGen: Change c-o-w existential implementation functions
* initialzeBufferWith(Copy|Take)OfBuffer value witness implementation for cow existentials
Implement and use initialzeBufferWith(Copy|Take)OfBuffer value witnesses for
copy-on-write existentials.
Before we used a free standing function but the overhead of doing so was
noticable (~20-30%) on micro benchmarks.
* IRGen: Use common getCopyOutOfLineBoxPointerFunction
* Add a runtime function to conditionally make a box unique
* Fix compilation of HeapObject.cpp on i386
* Fix IRGen test case
* Fix test case for i386
2017-03-27 20:51:02 -07:00
Max Moiseev
969b4814e2
Merge branch 'master' into new-integer-protocols
2017-03-27 20:40:15 -07:00
Hugh Bellamy
abfca72357
Run python linting on the file if running doctests
2017-03-27 12:31:56 +07:00
Slava Pestov
19b12aa3b1
Sema: Fix convenience init delegation to a convenience init in a generic base class
...
While in the constraint system, the delegation is modeled as
returning an instance of the derived class, in the AST we type
the reference as returning an instance of the base class, and
insert a downcast, because in SILGen we're calling the base
class initializer which is typed as returning the base class.
This bit of fixup logic wasn't happening if the base class was
generic, and so we were not inserting the cast, which would
crash in SILGen with an assert.
Fixes <rdar://problem/31000248>.
2017-03-26 00:00:53 -07:00
Max Moiseev
ec8e286b5c
Merge branch 'master' into new-integer-protocols
2017-03-24 14:14:00 -07:00
Doug Gregor
c4735314d1
Add test for SR-4016 / rdar://problem/30677848, which is now fixed.
2017-03-24 11:36:45 -07:00
practicalswift
297bf9a469
[swiftc (24 vs. 5511)] Add crasher in swift::TypeBase::getCanonicalType(...)
...
Add test case for crash triggered in `swift::TypeBase::getCanonicalType(...)`.
Current number of unresolved compiler crashers: 24 (5511 resolved)
/cc @slavapestov - just wanted to let you know that this crasher caused an assertion failure for the assertion `gpDecl->getDepth() != GenericTypeParamDecl::InvalidDepth && "parameter hasn't been validated"` added on 2017-02-22 by you in commit fdb0a186 :-)
Assertion failure in [`lib/AST/Type.cpp (line 1045)`](fba882ff21/lib/AST/Type.cpp (L1045) ):
```
Assertion `gpDecl->getDepth() != GenericTypeParamDecl::InvalidDepth && "parameter hasn't been validated"' failed.
When executing: swift::CanType swift::TypeBase::getCanonicalType()
```
Assertion context:
```c++
case TypeKind::GenericTypeParam: {
GenericTypeParamType *gp = cast<GenericTypeParamType>(this);
auto gpDecl = gp->getDecl();
assert(gpDecl->getDepth() != GenericTypeParamDecl::InvalidDepth &&
"parameter hasn't been validated");
Result = GenericTypeParamType::get(gpDecl->getDepth(), gpDecl->getIndex(),
gpDecl->getASTContext());
break;
}
```
Stack trace:
```
0 0x000000000394ec88 llvm::sys::PrintStackTrace(llvm::raw_ostream&) (/path/to/swift/bin/swift+0x394ec88)
1 0x000000000394f3c6 SignalHandler(int) (/path/to/swift/bin/swift+0x394f3c6)
2 0x00007f435f948390 __restore_rt (/lib/x86_64-linux-gnu/libpthread.so.0+0x11390)
3 0x00007f435de6e428 gsignal /build/glibc-9tT8Do/glibc-2.23/signal/../sysdeps/unix/sysv/linux/raise.c:54:0
4 0x00007f435de7002a abort /build/glibc-9tT8Do/glibc-2.23/stdlib/abort.c:91:0
5 0x00007f435de66bd7 __assert_fail_base /build/glibc-9tT8Do/glibc-2.23/assert/assert.c:92:0
6 0x00007f435de66c82 (/lib/x86_64-linux-gnu/libc.so.6+0x2dc82)
7 0x00000000014de90c swift::TypeBase::getCanonicalType() (/path/to/swift/bin/swift+0x14de90c)
8 0x00000000013c8713 swift::ErrorType::get(swift::Type) (/path/to/swift/bin/swift+0x13c8713)
9 0x00000000014eb982 llvm::Optional<swift::Type> llvm::function_ref<llvm::Optional<swift::Type> (swift::TypeBase*)>::callback_fn<substType(swift::Type, llvm::function_ref<swift::Type (swift::SubstitutableType*)>, llvm::function_ref<llvm::Optional<swift::ProtocolConformanceRef> (swift::CanType, swift::Type, swift::ProtocolType*)>, swift::OptionSet<swift::SubstFlags, unsigned int>)::$_17>(long, swift::TypeBase*) (/path/to/swift/bin/swift+0x14eb982)
10 0x00000000014e81e9 swift::Type::transformRec(llvm::function_ref<llvm::Optional<swift::Type> (swift::TypeBase*)>) const (/path/to/swift/bin/swift+0x14e81e9)
11 0x00000000014e73fe swift::Type::substDependentTypesWithErrorTypes() const (/path/to/swift/bin/swift+0x14e73fe)
12 0x0000000001485982 swift::GenericEnvironment::mapTypeIntoContext(swift::GenericEnvironment*, swift::Type) (/path/to/swift/bin/swift+0x1485982)
13 0x00000000014c3bf0 swift::UnqualifiedLookup::UnqualifiedLookup(swift::DeclName, swift::DeclContext*, swift::LazyResolver*, bool, swift::SourceLoc, bool, bool, bool) (/path/to/swift/bin/swift+0x14c3bf0)
14 0x00000000012cd847 swift::TypeChecker::lookupUnqualifiedType(swift::DeclContext*, swift::DeclName, swift::SourceLoc, swift::OptionSet<swift::NameLookupFlags, unsigned int>) (/path/to/swift/bin/swift+0x12cd847)
15 0x000000000131130e resolveTopLevelIdentTypeComponent(swift::TypeChecker&, swift::DeclContext*, swift::ComponentIdentTypeRepr*, swift::OptionSet<swift::TypeResolutionFlags, unsigned int>, bool, swift::GenericTypeResolver*, llvm::function_ref<bool (swift::TypeCheckRequest)>*) (/path/to/swift/bin/swift+0x131130e)
16 0x000000000130ba7e resolveIdentTypeComponent(swift::TypeChecker&, swift::DeclContext*, llvm::ArrayRef<swift::ComponentIdentTypeRepr*>, swift::OptionSet<swift::TypeResolutionFlags, unsigned int>, bool, swift::GenericTypeResolver*, llvm::function_ref<bool (swift::TypeCheckRequest)>*) (/path/to/swift/bin/swift+0x130ba7e)
17 0x000000000130b4a3 swift::TypeChecker::resolveIdentifierType(swift::DeclContext*, swift::IdentTypeRepr*, swift::OptionSet<swift::TypeResolutionFlags, unsigned int>, bool, swift::GenericTypeResolver*, llvm::function_ref<bool (swift::TypeCheckRequest)>*) (/path/to/swift/bin/swift+0x130b4a3)
18 0x000000000130c5b7 (anonymous namespace)::TypeResolver::resolveType(swift::TypeRepr*, swift::OptionSet<swift::TypeResolutionFlags, unsigned int>) (/path/to/swift/bin/swift+0x130c5b7)
19 0x000000000130c4bc swift::TypeChecker::resolveType(swift::TypeRepr*, swift::DeclContext*, swift::OptionSet<swift::TypeResolutionFlags, unsigned int>, swift::GenericTypeResolver*, llvm::function_ref<bool (swift::TypeCheckRequest)>*) (/path/to/swift/bin/swift+0x130c4bc)
20 0x000000000130abba swift::TypeChecker::validateType(swift::TypeLoc&, swift::DeclContext*, swift::OptionSet<swift::TypeResolutionFlags, unsigned int>, swift::GenericTypeResolver*, llvm::function_ref<bool (swift::TypeCheckRequest)>*) (/path/to/swift/bin/swift+0x130abba)
21 0x00000000012d0389 validateParameterType(swift::ParamDecl*, swift::DeclContext*, swift::OptionSet<swift::TypeResolutionFlags, unsigned int>, swift::GenericTypeResolver&, swift::TypeChecker&) (/path/to/swift/bin/swift+0x12d0389)
22 0x00000000012d0239 swift::TypeChecker::typeCheckParameterList(swift::ParameterList*, swift::DeclContext*, swift::OptionSet<swift::TypeResolutionFlags, unsigned int>, swift::GenericTypeResolver&) (/path/to/swift/bin/swift+0x12d0239)
23 0x00000000012ba9e3 (anonymous namespace)::DeclChecker::semaFuncParamPatterns(swift::AbstractFunctionDecl*, swift::GenericTypeResolver&) (/path/to/swift/bin/swift+0x12ba9e3)
24 0x00000000012ae314 (anonymous namespace)::DeclChecker::visitFuncDecl(swift::FuncDecl*) (/path/to/swift/bin/swift+0x12ae314)
25 0x000000000129b417 (anonymous namespace)::DeclChecker::visit(swift::Decl*) (/path/to/swift/bin/swift+0x129b417)
26 0x000000000129d272 swift::TypeChecker::validateDecl(swift::ValueDecl*) (/path/to/swift/bin/swift+0x129d272)
27 0x00000000014c0e45 swift::namelookup::ResolutionKind recordImportDecls<llvm::DenseMap<swift::Identifier, std::pair<swift::namelookup::ResolutionKind, llvm::SmallSet<swift::CanType, 4u, (anonymous namespace)::SortCanType> >, llvm::DenseMapInfo<swift::Identifier>, llvm::detail::DenseMapPair<swift::Identifier, std::pair<swift::namelookup::ResolutionKind, llvm::SmallSet<swift::CanType, 4u, (anonymous namespace)::SortCanType> > > > >(swift::LazyResolver*, llvm::SmallVectorImpl<swift::ValueDecl*>&, llvm::ArrayRef<swift::ValueDecl*>, llvm::DenseMap<swift::Identifier, std::pair<swift::namelookup::ResolutionKind, llvm::SmallSet<swift::CanType, 4u, (anonymous namespace)::SortCanType> >, llvm::DenseMapInfo<swift::Identifier>, llvm::detail::DenseMapPair<swift::Identifier, std::pair<swift::namelookup::ResolutionKind, llvm::SmallSet<swift::CanType, 4u, (anonymous namespace)::SortCanType> > > >&, swift::namelookup::ResolutionKind) (/path/to/swift/bin/swift+0x14c0e45)
28 0x00000000014bf05a void lookupInModule<llvm::DenseMap<swift::Identifier, std::pair<swift::namelookup::ResolutionKind, llvm::SmallSet<swift::CanType, 4u, (anonymous namespace)::SortCanType> >, llvm::DenseMapInfo<swift::Identifier>, llvm::detail::DenseMapPair<swift::Identifier, std::pair<swift::namelookup::ResolutionKind, llvm::SmallSet<swift::CanType, 4u, (anonymous namespace)::SortCanType> > > >, swift::namelookup::lookupVisibleDeclsInModule(swift::ModuleDecl*, llvm::ArrayRef<std::pair<swift::Identifier, swift::SourceLoc> >, 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*> >)::$_1>(swift::ModuleDecl*, llvm::ArrayRef<std::pair<swift::Identifier, swift::SourceLoc> >, llvm::SmallVectorImpl<swift::ValueDecl*>&, swift::namelookup::ResolutionKind, bool, swift::LazyResolver*, llvm::SmallDenseMap<std::pair<llvm::ArrayRef<std::pair<swift::Identifier, swift::SourceLoc> >, swift::ModuleDecl*>, llvm::TinyPtrVector<swift::ValueDecl*>, 32u, llvm::DenseMapInfo<std::pair<llvm::ArrayRef<std::pair<swift::Identifier, swift::SourceLoc> >, swift::ModuleDecl*> >, llvm::detail::DenseMapPair<std::pair<llvm::ArrayRef<std::pair<swift::Identifier, swift::SourceLoc> >, swift::ModuleDecl*>, llvm::TinyPtrVector<swift::ValueDecl*> > >&, swift::DeclContext const*, bool, llvm::ArrayRef<std::pair<llvm::ArrayRef<std::pair<swift::Identifier, swift::SourceLoc> >, swift::ModuleDecl*> >, swift::namelookup::lookupVisibleDeclsInModule(swift::ModuleDecl*, llvm::ArrayRef<std::pair<swift::Identifier, swift::SourceLoc> >, 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*> >)::$_1) (/path/to/swift/bin/swift+0x14bf05a)
29 0x00000000014be8a3 swift::namelookup::lookupVisibleDeclsInModule(swift::ModuleDecl*, llvm::ArrayRef<std::pair<swift::Identifier, swift::SourceLoc> >, 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*> >) (/path/to/swift/bin/swift+0x14be8a3)
30 0x00000000014acf4d swift::lookupVisibleDecls(swift::VisibleDeclConsumer&, swift::DeclContext const*, swift::LazyResolver*, bool, swift::SourceLoc) (/path/to/swift/bin/swift+0x14acf4d)
31 0x00000000012ce638 swift::TypeChecker::performTypoCorrection(swift::DeclContext*, swift::DeclRefKind, swift::Type, swift::DeclName, swift::SourceLoc, swift::OptionSet<swift::NameLookupFlags, unsigned int>, swift::LookupResult&, unsigned int) (/path/to/swift/bin/swift+0x12ce638)
32 0x00000000012823e4 swift::TypeChecker::resolveDeclRefExpr(swift::UnresolvedDeclRefExpr*, swift::DeclContext*) (/path/to/swift/bin/swift+0x12823e4)
33 0x000000000128e8d2 (anonymous namespace)::PreCheckExpression::walkToExprPre(swift::Expr*) (/path/to/swift/bin/swift+0x128e8d2)
34 0x000000000144121b swift::Expr::walk(swift::ASTWalker&) (/path/to/swift/bin/swift+0x144121b)
35 0x0000000001283665 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>) (/path/to/swift/bin/swift+0x1283665)
36 0x0000000001286d96 swift::TypeChecker::typeCheckExpression(swift::Expr*&, swift::DeclContext*, swift::TypeLoc, swift::ContextualTypePurpose, swift::OptionSet<swift::TypeCheckExprFlags, unsigned int>, swift::ExprTypeCheckListener*, swift::constraints::ConstraintSystem*) (/path/to/swift/bin/swift+0x1286d96)
37 0x000000000128aa81 swift::TypeChecker::typeCheckBinding(swift::Pattern*&, swift::Expr*&, swift::DeclContext*, bool) (/path/to/swift/bin/swift+0x128aa81)
38 0x000000000128ac46 swift::TypeChecker::typeCheckPatternBinding(swift::PatternBindingDecl*, unsigned int, bool) (/path/to/swift/bin/swift+0x128ac46)
39 0x00000000012a0e28 validatePatternBindingEntries(swift::TypeChecker&, swift::PatternBindingDecl*) (/path/to/swift/bin/swift+0x12a0e28)
40 0x000000000129b334 (anonymous namespace)::DeclChecker::visit(swift::Decl*) (/path/to/swift/bin/swift+0x129b334)
41 0x00000000012aac7b (anonymous namespace)::DeclChecker::visitStructDecl(swift::StructDecl*) (/path/to/swift/bin/swift+0x12aac7b)
42 0x000000000129b3e7 (anonymous namespace)::DeclChecker::visit(swift::Decl*) (/path/to/swift/bin/swift+0x129b3e7)
43 0x000000000129b1f3 swift::TypeChecker::typeCheckDecl(swift::Decl*, bool) (/path/to/swift/bin/swift+0x129b1f3)
44 0x0000000001319005 swift::performTypeChecking(swift::SourceFile&, swift::TopLevelContext&, swift::OptionSet<swift::TypeCheckingFlags, unsigned int>, unsigned int, unsigned int) (/path/to/swift/bin/swift+0x1319005)
45 0x0000000000f8f5b6 swift::CompilerInstance::performSema() (/path/to/swift/bin/swift+0xf8f5b6)
46 0x00000000004a76bb swift::performFrontend(llvm::ArrayRef<char const*>, char const*, void*, swift::FrontendObserver*) (/path/to/swift/bin/swift+0x4a76bb)
47 0x00000000004650b7 main (/path/to/swift/bin/swift+0x4650b7)
48 0x00007f435de59830 __libc_start_main /build/glibc-9tT8Do/glibc-2.23/csu/../csu/libc-start.c:325:0
49 0x0000000000462759 _start (/path/to/swift/bin/swift+0x462759)
```
2017-03-24 15:43:39 +01:00
Max Moiseev
2c9be47551
Merge branch 'master' into new-integer-protocols
2017-03-23 16:46:01 -07:00
Hugh Bellamy
fbad5fdfa6
Integrate python linting into validation tests
2017-03-23 14:05:15 +07:00
Max Moiseev
6f6c2aee8c
Fixing the rest of the tests
2017-03-22 16:06:10 -07:00
Max Moiseev
b9fb3badc8
Merge remote-tracking branch 'origin/master' into new-integer-protocols
2017-03-22 12:30:24 -07:00
Robert Widmann
2c19ceb1c4
Update prefix-drop regression test ( #8194 )
2017-03-22 11:25:55 -04:00
Mishal Shah
dd9c81c965
Revert "Integrate python-lint into validation tests"
2017-03-21 12:24:46 -07:00
Hugh Bellamy
7007c34dfd
Integrate python linting into validation tests
2017-03-21 19:28:31 +07:00
Slava Pestov
3ef5ef0ac9
Merge pull request #8232 from slavapestov/two-more-crashers
...
Last two crashers for the evening
2017-03-21 02:25:57 -07:00
Slava Pestov
e8413ba134
Merge pull request #8229 from slavapestov/another-protocol-typealias-crasher-yay
...
Add another crasher with protocol typealiases
2017-03-21 02:02:16 -07:00
Slava Pestov
6019754b54
Last two crashers for the evening
2017-03-21 01:45:53 -07:00
Slava Pestov
47a0cb1861
Add another crasher with protocol typealiases
2017-03-21 00:21:21 -07:00
Slava Pestov
a3a290eb60
Mangling: Fix bug in the logic for dropping same-type constraints
...
It's not correct to drop a constraint if one of the two types
structurally contains generic parameters at the method depth.
2017-03-21 00:15:18 -07:00
Slava Pestov
a3067a19bd
Add a couple of crashers
2017-03-20 23:15:23 -07:00
swift-ci
3e085fca4b
Merge pull request #7946 from DougGregor/all-conformance-constraint-sources
2017-03-18 01:30:27 -07:00
David Hart
ecdcac5aa2
Resolve crasher 28704 ( #8158 )
...
This crash happens because shouldAddSelfFixit (a check for the expected_self_before_reference diagnotic) performs name lookup inside the parser, which causes a search for extensions, which triggers the mangler, which can get confused if we are in an unfinished declaration (a PatternBindingInitilizer in this case).
A cleaner fix would be to move that logic inside Sema, but it would require much more refactoring that I don’t feel comfortable doing. Instead, this band-aid checks if the innermost type is inside a local context. If that’s the case, we can ignore the search for extensions.
2017-03-17 18:43:23 -07:00
swift-ci
242a177e73
Merge pull request #8093 from hartbit/fix-crasher
2017-03-17 13:19:12 -07:00
Doug Gregor
87dab47d5d
[HACK] XFAIL a crasher that was passing due to bogus canonicalization
...
This test was passing for the wrong reasons before. We need to
correctly model cases where a nested type of an abstract conformance is
in fact concrete and, therefore, has concrete conformances. XFAIL for now.
2017-03-16 23:16:32 -10:00
practicalswift
b3a1f3f6d4
[gardening] Remove "// REQUIRES: asserts" from fixed crasher
2017-03-17 08:08:12 +01:00
David Hart
732ae1b2c2
Removed requires assert
2017-03-17 07:37:52 +01:00
Michael Gottesman
96a087ecdc
Update requires line in bug-reducer.test-sh to work around master-next not liking rdar:// in requires lines.
2017-03-16 14:55:23 -07:00
eeckstein
e78445b437
Merge pull request #8126 from eeckstein/newmangling
...
Mangling: enable new mangling for symbols
2017-03-16 14:19:00 -07:00
swift-ci
b7db464041
Merge pull request #8148 from practicalswift/swiftc-28723-unreachable-executed-at-swift-lib-sema-csdiag-cpp-4012
2017-03-16 12:29:59 -07:00
Erik Eckstein
2a55b26e46
Mangling: enable new mangling for symbols
2017-03-16 12:04:08 -07:00
Rintaro Ishizaki
f4f5d1d063
Mark a crasher fixed ( #8150 )
...
28722-swift-genericsignaturebuilder-resolvearchetype-swift-type.swift
has been fixed by c2224f3 #8112
2017-03-17 00:50:54 +09:00
Rintaro Ishizaki
d50c88767b
Disable non-deterministic crasher ( #8149 )
2017-03-16 22:56:51 +09:00
practicalswift
71845c060b
[swiftc (27 vs. 5507)] Add crasher in swift::constraints::ConstraintSystem::diagnoseFailureForExpr(...)
...
Add test case for crash triggered in `swift::constraints::ConstraintSystem::diagnoseFailureForExpr(...)`.
Current number of unresolved compiler crashers: 27 (5507 resolved)
Stack trace:
```
0 0x000000000394f3c8 llvm::sys::PrintStackTrace(llvm::raw_ostream&) (/path/to/swift/bin/swift+0x394f3c8)
1 0x000000000394fb06 SignalHandler(int) (/path/to/swift/bin/swift+0x394fb06)
2 0x00007f1eb6c813e0 __restore_rt (/lib/x86_64-linux-gnu/libpthread.so.0+0x113e0)
3 0x00007f1eb51a7428 gsignal /build/glibc-Qz8a69/glibc-2.23/signal/../sysdeps/unix/sysv/linux/raise.c:54:0
4 0x00007f1eb51a902a abort /build/glibc-Qz8a69/glibc-2.23/stdlib/abort.c:91:0
5 0x00000000038eb86d llvm::llvm_unreachable_internal(char const*, char const*, unsigned int) (/path/to/swift/bin/swift+0x38eb86d)
6 0x000000000133bf29 (anonymous namespace)::FailureDiagnosis::diagnoseContextualConversionError() (/path/to/swift/bin/swift+0x133bf29)
7 0x00000000013395a8 swift::constraints::ConstraintSystem::diagnoseFailureForExpr(swift::Expr*) (/path/to/swift/bin/swift+0x13395a8)
8 0x00000000013402f2 swift::constraints::ConstraintSystem::salvage(llvm::SmallVectorImpl<swift::constraints::Solution>&, swift::Expr*) (/path/to/swift/bin/swift+0x13402f2)
9 0x000000000127b718 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>) (/path/to/swift/bin/swift+0x127b718)
10 0x000000000127ed46 swift::TypeChecker::typeCheckExpression(swift::Expr*&, swift::DeclContext*, swift::TypeLoc, swift::ContextualTypePurpose, swift::OptionSet<swift::TypeCheckExprFlags, unsigned int>, swift::ExprTypeCheckListener*, swift::constraints::ConstraintSystem*) (/path/to/swift/bin/swift+0x127ed46)
11 0x000000000132430c getCallerDefaultArg(swift::constraints::ConstraintSystem&, swift::DeclContext*, swift::SourceLoc, swift::ConcreteDeclRef&, unsigned int) (/path/to/swift/bin/swift+0x132430c)
12 0x000000000133269f (anonymous namespace)::ExprRewriter::coerceCallArguments(swift::Expr*, swift::Type, llvm::PointerUnion<swift::ApplyExpr*, llvm::PointerEmbeddedInt<unsigned int, 2> >, llvm::ArrayRef<swift::Identifier>, bool, swift::constraints::ConstraintLocatorBuilder) (/path/to/swift/bin/swift+0x133269f)
13 0x000000000131e5a8 (anonymous namespace)::ExprRewriter::finishApply(swift::ApplyExpr*, swift::Type, swift::constraints::ConstraintLocatorBuilder) (/path/to/swift/bin/swift+0x131e5a8)
14 0x0000000001334053 (anonymous namespace)::ExprRewriter::visitApplyExpr(swift::ApplyExpr*) (/path/to/swift/bin/swift+0x1334053)
15 0x000000000131b074 (anonymous namespace)::ExprRewriter::walkToExprPost(swift::Expr*) (/path/to/swift/bin/swift+0x131b074)
16 0x0000000001320671 (anonymous namespace)::ExprWalker::walkToExprPost(swift::Expr*) (/path/to/swift/bin/swift+0x1320671)
17 0x000000000143989c swift::Expr::walk(swift::ASTWalker&) (/path/to/swift/bin/swift+0x143989c)
18 0x0000000001317ecf swift::constraints::ConstraintSystem::applySolution(swift::constraints::Solution&, swift::Expr*, swift::Type, bool, bool, bool) (/path/to/swift/bin/swift+0x1317ecf)
19 0x000000000127edd0 swift::TypeChecker::typeCheckExpression(swift::Expr*&, swift::DeclContext*, swift::TypeLoc, swift::ContextualTypePurpose, swift::OptionSet<swift::TypeCheckExprFlags, unsigned int>, swift::ExprTypeCheckListener*, swift::constraints::ConstraintSystem*) (/path/to/swift/bin/swift+0x127edd0)
20 0x00000000012fe305 swift::ASTVisitor<(anonymous namespace)::StmtChecker, void, swift::Stmt*, void, void, void, void>::visit(swift::Stmt*) (/path/to/swift/bin/swift+0x12fe305)
21 0x00000000012fd156 swift::TypeChecker::typeCheckTopLevelCodeDecl(swift::TopLevelCodeDecl*) (/path/to/swift/bin/swift+0x12fd156)
22 0x0000000001312630 swift::performTypeChecking(swift::SourceFile&, swift::TopLevelContext&, swift::OptionSet<swift::TypeCheckingFlags, unsigned int>, unsigned int, unsigned int) (/path/to/swift/bin/swift+0x1312630)
23 0x0000000000f86726 swift::CompilerInstance::performSema() (/path/to/swift/bin/swift+0xf86726)
24 0x00000000004a7016 swift::performFrontend(llvm::ArrayRef<char const*>, char const*, void*, swift::FrontendObserver*) (/path/to/swift/bin/swift+0x4a7016)
25 0x0000000000465137 main (/path/to/swift/bin/swift+0x465137)
26 0x00007f1eb5192830 __libc_start_main /build/glibc-Qz8a69/glibc-2.23/csu/../csu/libc-start.c:325:0
27 0x00000000004627d9 _start (/path/to/swift/bin/swift+0x4627d9)
```
2017-03-16 10:48:51 +01:00
practicalswift
2ba6e8eab8
[swiftc (26 vs. 5507)] Add crasher in swift::GenericParamKey::findIndexIn
...
Add test case for crash triggered in `swift::GenericParamKey::findIndexIn`.
Current number of unresolved compiler crashers: 26 (5507 resolved)
Stack trace:
```
0 0x000000000394f3c8 llvm::sys::PrintStackTrace(llvm::raw_ostream&) (/path/to/swift/bin/swift+0x394f3c8)
1 0x000000000394fb06 SignalHandler(int) (/path/to/swift/bin/swift+0x394fb06)
2 0x00007f2a3dba23e0 __restore_rt (/lib/x86_64-linux-gnu/libpthread.so.0+0x113e0)
3 0x000000000148104d swift::GenericParamKey::findIndexIn(llvm::ArrayRef<swift::GenericTypeParamType*>) const (/path/to/swift/bin/swift+0x148104d)
4 0x000000000148b72e swift::GenericSignatureBuilder::resolveArchetype(swift::Type) (/path/to/swift/bin/swift+0x148b72e)
5 0x000000000147e31a swift::GenericEnvironment::QueryInterfaceTypeSubstitutions::operator()(swift::SubstitutableType*) const (/path/to/swift/bin/swift+0x147e31a)
6 0x00000000014e541d llvm::Optional<swift::Type> llvm::function_ref<llvm::Optional<swift::Type> (swift::TypeBase*)>::callback_fn<substType(swift::Type, llvm::function_ref<swift::Type (swift::SubstitutableType*)>, llvm::function_ref<llvm::Optional<swift::ProtocolConformanceRef> (swift::CanType, swift::Type, swift::ProtocolType*)>, swift::OptionSet<swift::SubstFlags, unsigned int>)::$_16>(long, swift::TypeBase*) (/path/to/swift/bin/swift+0x14e541d)
7 0x00000000014e1e79 swift::Type::transformRec(llvm::function_ref<llvm::Optional<swift::Type> (swift::TypeBase*)>) const (/path/to/swift/bin/swift+0x14e1e79)
8 0x00000000014e0693 swift::Type::subst(llvm::function_ref<swift::Type (swift::SubstitutableType*)>, llvm::function_ref<llvm::Optional<swift::ProtocolConformanceRef> (swift::CanType, swift::Type, swift::ProtocolType*)>, swift::OptionSet<swift::SubstFlags, unsigned int>) const (/path/to/swift/bin/swift+0x14e0693)
9 0x000000000147dfe4 swift::GenericEnvironment::mapTypeIntoContext(swift::GenericEnvironment*, swift::Type) (/path/to/swift/bin/swift+0x147dfe4)
10 0x000000000146459f swift::ParamDecl::createSelf(swift::SourceLoc, swift::DeclContext*, bool, bool) (/path/to/swift/bin/swift+0x146459f)
11 0x00000000014c5443 swift::ParameterList::createSelf(swift::SourceLoc, swift::DeclContext*, bool, bool) (/path/to/swift/bin/swift+0x14c5443)
12 0x00000000013709e0 createGetterPrototype(swift::AbstractStorageDecl*, swift::TypeChecker&) (/path/to/swift/bin/swift+0x13709e0)
13 0x000000000136a33c addTrivialAccessorsToStorage(swift::AbstractStorageDecl*, swift::TypeChecker&) (/path/to/swift/bin/swift+0x136a33c)
14 0x000000000137048b swift::maybeAddAccessorsToVariable(swift::VarDecl*, swift::TypeChecker&) (/path/to/swift/bin/swift+0x137048b)
15 0x0000000001295d9f swift::TypeChecker::validateDecl(swift::ValueDecl*) (/path/to/swift/bin/swift+0x1295d9f)
16 0x00000000012a95a3 std::_Function_handler<void (swift::VarDecl*), (anonymous namespace)::DeclChecker::visitBoundVars(swift::Pattern*)::{lambda(swift::VarDecl*)#1}>::_M_invoke(std::_Any_data const&, swift::VarDecl*&&) (/path/to/swift/bin/swift+0x12a95a3)
17 0x00000000014c66bf swift::Pattern::forEachVariable(std::function<void (swift::VarDecl*)> const&) const (/path/to/swift/bin/swift+0x14c66bf)
18 0x0000000001293462 (anonymous namespace)::DeclChecker::visit(swift::Decl*) (/path/to/swift/bin/swift+0x1293462)
19 0x00000000012a263b (anonymous namespace)::DeclChecker::visitExtensionDecl(swift::ExtensionDecl*) (/path/to/swift/bin/swift+0x12a263b)
20 0x000000000129326b (anonymous namespace)::DeclChecker::visit(swift::Decl*) (/path/to/swift/bin/swift+0x129326b)
21 0x00000000012931a3 swift::TypeChecker::typeCheckDecl(swift::Decl*, bool) (/path/to/swift/bin/swift+0x12931a3)
22 0x00000000013125b5 swift::performTypeChecking(swift::SourceFile&, swift::TopLevelContext&, swift::OptionSet<swift::TypeCheckingFlags, unsigned int>, unsigned int, unsigned int) (/path/to/swift/bin/swift+0x13125b5)
23 0x0000000000f86726 swift::CompilerInstance::performSema() (/path/to/swift/bin/swift+0xf86726)
24 0x00000000004a7016 swift::performFrontend(llvm::ArrayRef<char const*>, char const*, void*, swift::FrontendObserver*) (/path/to/swift/bin/swift+0x4a7016)
25 0x0000000000465137 main (/path/to/swift/bin/swift+0x465137)
26 0x00007f2a3c0b3830 __libc_start_main /build/glibc-Qz8a69/glibc-2.23/csu/../csu/libc-start.c:325:0
27 0x00000000004627d9 _start (/path/to/swift/bin/swift+0x4627d9)
```
2017-03-16 08:35:18 +01:00
practicalswift
bdc72aabb4
Merge pull request #8133 from practicalswift/swiftc-28721-unreachable-executed-at-swift-lib-ast-astmangler-cpp-451
...
[swiftc (25 vs. 5507)] Add crasher in swift::NewMangling::ASTMangler::appendType(...)
2017-03-16 08:35:02 +01:00
Robert Widmann
703f129bdc
Merge pull request #8087 from CodaFi/electoral-college
...
[SR-4240] Remove erroneous drop(while:) optimization
2017-03-15 22:18:58 -04:00
practicalswift
2144bac834
[swiftc (25 vs. 5507)] Add crasher in swift::NewMangling::ASTMangler::appendType(...)
...
Add test case for crash triggered in `swift::NewMangling::ASTMangler::appendType(...)`.
Current number of unresolved compiler crashers: 25 (5507 resolved)
Stack trace:
```
0 0x000000000394bcd8 llvm::sys::PrintStackTrace(llvm::raw_ostream&) (/path/to/swift/bin/swift+0x394bcd8)
1 0x000000000394c416 SignalHandler(int) (/path/to/swift/bin/swift+0x394c416)
2 0x00007fe2009d83e0 __restore_rt (/lib/x86_64-linux-gnu/libpthread.so.0+0x113e0)
3 0x00007fe1feefe428 gsignal /build/glibc-Qz8a69/glibc-2.23/signal/../sysdeps/unix/sysv/linux/raise.c:54:0
4 0x00007fe1fef0002a abort /build/glibc-Qz8a69/glibc-2.23/stdlib/abort.c:91:0
5 0x00000000038e83fd llvm::llvm_unreachable_internal(char const*, char const*, unsigned int) (/path/to/swift/bin/swift+0x38e83fd)
6 0x00000000013fa59f swift::NewMangling::ASTMangler::appendType(swift::Type) (/path/to/swift/bin/swift+0x13fa59f)
7 0x00000000013fd444 swift::NewMangling::ASTMangler::appendFunctionSignature(swift::AnyFunctionType*) (/path/to/swift/bin/swift+0x13fd444)
8 0x00000000013fc949 swift::NewMangling::ASTMangler::appendFunctionType(swift::AnyFunctionType*) (/path/to/swift/bin/swift+0x13fc949)
9 0x00000000013fe1d8 swift::NewMangling::ASTMangler::appendClosureComponents(swift::Type, unsigned int, bool, swift::DeclContext const*, swift::DeclContext const*) (/path/to/swift/bin/swift+0x13fe1d8)
10 0x00000000013fe1a2 swift::NewMangling::ASTMangler::appendClosureComponents(swift::Type, unsigned int, bool, swift::DeclContext const*, swift::DeclContext const*) (/path/to/swift/bin/swift+0x13fe1a2)
11 0x00000000013f7d4f swift::NewMangling::ASTMangler::appendNominalType(swift::NominalTypeDecl const*) (/path/to/swift/bin/swift+0x13f7d4f)
12 0x00000000013f7cf1 swift::NewMangling::ASTMangler::mangleNominalType[abi:cxx11](swift::NominalTypeDecl const*) (/path/to/swift/bin/swift+0x13f7cf1)
13 0x000000000106f72e swift::ModuleFile::loadExtensions(swift::NominalTypeDecl*) (/path/to/swift/bin/swift+0x106f72e)
14 0x00000000010cd671 swift::SerializedModuleLoader::loadExtensions(swift::NominalTypeDecl*, unsigned int) (/path/to/swift/bin/swift+0x10cd671)
15 0x00000000013ba7a0 swift::ASTContext::loadExtensions(swift::NominalTypeDecl*, unsigned int) (/path/to/swift/bin/swift+0x13ba7a0)
16 0x000000000145bec5 swift::NominalTypeDecl::getExtensions() (/path/to/swift/bin/swift+0x145bec5)
17 0x00000000014c08f4 swift::NominalTypeDecl::lookupDirect(swift::DeclName, bool) (/path/to/swift/bin/swift+0x14c08f4)
18 0x0000000001292f9d (anonymous namespace)::DeclChecker::visit(swift::Decl*) (/path/to/swift/bin/swift+0x1292f9d)
19 0x0000000001292803 swift::TypeChecker::typeCheckDecl(swift::Decl*, bool) (/path/to/swift/bin/swift+0x1292803)
20 0x00000000013714c8 swift::createImplicitConstructor(swift::TypeChecker&, swift::NominalTypeDecl*, swift::ImplicitConstructorKind) (/path/to/swift/bin/swift+0x13714c8)
21 0x000000000129a8bf swift::TypeChecker::defineDefaultConstructor(swift::NominalTypeDecl*) (/path/to/swift/bin/swift+0x129a8bf)
22 0x000000000129978e swift::TypeChecker::addImplicitConstructors(swift::NominalTypeDecl*) (/path/to/swift/bin/swift+0x129978e)
23 0x00000000012a223e (anonymous namespace)::DeclChecker::visitStructDecl(swift::StructDecl*) (/path/to/swift/bin/swift+0x12a223e)
24 0x00000000012929f7 (anonymous namespace)::DeclChecker::visit(swift::Decl*) (/path/to/swift/bin/swift+0x12929f7)
25 0x00000000012a1c9b (anonymous namespace)::DeclChecker::visitExtensionDecl(swift::ExtensionDecl*) (/path/to/swift/bin/swift+0x12a1c9b)
26 0x00000000012928cb (anonymous namespace)::DeclChecker::visit(swift::Decl*) (/path/to/swift/bin/swift+0x12928cb)
27 0x0000000001292803 swift::TypeChecker::typeCheckDecl(swift::Decl*, bool) (/path/to/swift/bin/swift+0x1292803)
28 0x00000000012fd9f6 swift::ASTVisitor<(anonymous namespace)::StmtChecker, void, swift::Stmt*, void, void, void, void>::visit(swift::Stmt*) (/path/to/swift/bin/swift+0x12fd9f6)
29 0x00000000012fc6eb swift::TypeChecker::typeCheckClosureBody(swift::ClosureExpr*) (/path/to/swift/bin/swift+0x12fc6eb)
30 0x00000000013177bc swift::constraints::ConstraintSystem::applySolution(swift::constraints::Solution&, swift::Expr*, swift::Type, bool, bool, bool) (/path/to/swift/bin/swift+0x13177bc)
31 0x000000000127e430 swift::TypeChecker::typeCheckExpression(swift::Expr*&, swift::DeclContext*, swift::TypeLoc, swift::ContextualTypePurpose, swift::OptionSet<swift::TypeCheckExprFlags, unsigned int>, swift::ExprTypeCheckListener*, swift::constraints::ConstraintSystem*) (/path/to/swift/bin/swift+0x127e430)
32 0x0000000001282091 swift::TypeChecker::typeCheckBinding(swift::Pattern*&, swift::Expr*&, swift::DeclContext*, bool) (/path/to/swift/bin/swift+0x1282091)
33 0x0000000001282256 swift::TypeChecker::typeCheckPatternBinding(swift::PatternBindingDecl*, unsigned int, bool) (/path/to/swift/bin/swift+0x1282256)
34 0x0000000001298438 validatePatternBindingEntries(swift::TypeChecker&, swift::PatternBindingDecl*) (/path/to/swift/bin/swift+0x1298438)
35 0x00000000012948b9 swift::TypeChecker::validateDecl(swift::ValueDecl*) (/path/to/swift/bin/swift+0x12948b9)
36 0x000000000127935c swift::TypeChecker::resolveDeclRefExpr(swift::UnresolvedDeclRefExpr*, swift::DeclContext*) (/path/to/swift/bin/swift+0x127935c)
37 0x0000000001285ee2 (anonymous namespace)::PreCheckExpression::walkToExprPre(swift::Expr*) (/path/to/swift/bin/swift+0x1285ee2)
38 0x000000000143b830 (anonymous namespace)::Traversal::visitApplyExpr(swift::ApplyExpr*) (/path/to/swift/bin/swift+0x143b830)
39 0x0000000001439822 swift::ASTVisitor<(anonymous namespace)::Traversal, swift::Expr*, swift::Stmt*, bool, swift::Pattern*, bool, void>::visit(swift::Expr*) (/path/to/swift/bin/swift+0x1439822)
40 0x00000000014383ab swift::Expr::walk(swift::ASTWalker&) (/path/to/swift/bin/swift+0x14383ab)
41 0x000000000127ac75 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>) (/path/to/swift/bin/swift+0x127ac75)
42 0x000000000127e8c6 swift::TypeChecker::getTypeOfExpressionWithoutApplying(swift::Expr*&, swift::DeclContext*, swift::ConcreteDeclRef&, swift::FreeTypeVariableBinding, swift::ExprTypeCheckListener*) (/path/to/swift/bin/swift+0x127e8c6)
43 0x000000000135cb33 (anonymous namespace)::FailureDiagnosis::diagnoseAmbiguousMultiStatementClosure(swift::ClosureExpr*) (/path/to/swift/bin/swift+0x135cb33)
44 0x000000000133e2c5 (anonymous namespace)::FailureDiagnosis::diagnoseAmbiguity(swift::Expr*) (/path/to/swift/bin/swift+0x133e2c5)
45 0x0000000001338d17 swift::constraints::ConstraintSystem::diagnoseFailureForExpr(swift::Expr*) (/path/to/swift/bin/swift+0x1338d17)
46 0x000000000133fa42 swift::constraints::ConstraintSystem::salvage(llvm::SmallVectorImpl<swift::constraints::Solution>&, swift::Expr*) (/path/to/swift/bin/swift+0x133fa42)
47 0x000000000127ad78 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>) (/path/to/swift/bin/swift+0x127ad78)
48 0x000000000127e3a6 swift::TypeChecker::typeCheckExpression(swift::Expr*&, swift::DeclContext*, swift::TypeLoc, swift::ContextualTypePurpose, swift::OptionSet<swift::TypeCheckExprFlags, unsigned int>, swift::ExprTypeCheckListener*, swift::constraints::ConstraintSystem*) (/path/to/swift/bin/swift+0x127e3a6)
49 0x00000000012fda55 swift::ASTVisitor<(anonymous namespace)::StmtChecker, void, swift::Stmt*, void, void, void, void>::visit(swift::Stmt*) (/path/to/swift/bin/swift+0x12fda55)
50 0x00000000012fc8a6 swift::TypeChecker::typeCheckTopLevelCodeDecl(swift::TopLevelCodeDecl*) (/path/to/swift/bin/swift+0x12fc8a6)
51 0x0000000001311d80 swift::performTypeChecking(swift::SourceFile&, swift::TopLevelContext&, swift::OptionSet<swift::TypeCheckingFlags, unsigned int>, unsigned int, unsigned int) (/path/to/swift/bin/swift+0x1311d80)
52 0x0000000000f84ee6 swift::CompilerInstance::performSema() (/path/to/swift/bin/swift+0xf84ee6)
53 0x00000000004a7136 swift::performFrontend(llvm::ArrayRef<char const*>, char const*, void*, swift::FrontendObserver*) (/path/to/swift/bin/swift+0x4a7136)
54 0x0000000000465257 main (/path/to/swift/bin/swift+0x465257)
55 0x00007fe1feee9830 __libc_start_main /build/glibc-Qz8a69/glibc-2.23/csu/../csu/libc-start.c:325:0
56 0x00000000004628f9 _start (/path/to/swift/bin/swift+0x4628f9)
```
2017-03-16 00:39:54 +01:00
swift-ci
34ed6b0347
Merge pull request #8067 from practicalswift/swiftc-28720-swift-typebase-getcanonicaltype
2017-03-15 16:38:57 -07:00
Robert Widmann
81968e21ff
Remove erroneous drop(while:) optimization
...
Calling drop(while: ) after prefix() on a pure Sequence loses the
prefix, because in the internal drop(while: ) override grabs the
underlying base iterator from _PrefixSequence and wraps it in a
_DropWhileSequence.
2017-03-15 17:01:13 -04:00
practicalswift
0a187da3c9
Mark as fixed.
2017-03-15 14:39:44 +01:00
David Hart
ba13a894c0
Fixed crasher 28707
...
The @_versioned accessibility check is done against the formal access. But the diagnostics is printed with getAccessForDiagnostics. In cases where the effective access is internal, the diagnostics will crash. Example:
```
class A { // implicitly internal
@_versioned public var a: Int = 0 // explicity public
}
```
2017-03-15 07:38:53 +01:00
John McCall
f3bfc777be
Merge pull request #8072 from rjmccall/irgen-conformance-access-paths
...
Use conformance access paths in IRGen
2017-03-14 11:01:42 -04:00
John McCall
22382f7e15
Reimplement associated conformance IRGen using Doug's conformance
...
access path work.
Having done so, simplify archetype TypeInfos by removing a now-
unnecessary layer of abstraction.
2017-03-14 03:48:10 -04:00
Slava Pestov
1248f8054e
Sema: Fix another compiler_crasher regression from associated type where clause work
...
If a protocol's signature is not valid yet, don't attempt a
conformance check.
2017-03-14 00:10:44 -07:00
Slava Pestov
f0e3459068
AST: Fix compiler_crasher regression from associated type where clause work
...
New GenericTypeParamDecls should always be created with an
InvalidDepth, to prevent canonicalization before the generic
parameter list has been type checked.
2017-03-14 00:10:43 -07:00
Robert Widmann
6543405e2d
[SR-4219] Resolve non-deterministic compiler crashes
...
These were leftover from the #8059 , which plugged a type variable leak
caused by type checking invalid default argument expressions.
2017-03-14 00:46:50 -04:00
practicalswift
5ae515fd1c
[swiftc (51 vs. 5480)] Add crasher in swift::TypeBase::getCanonicalType(...)
...
Add test case for crash triggered in `swift::TypeBase::getCanonicalType(...)`.
Current number of unresolved compiler crashers: 51 (5480 resolved)
Stack trace:
```
0 0x0000000003952c28 llvm::sys::PrintStackTrace(llvm::raw_ostream&) (/path/to/swift/bin/swift+0x3952c28)
1 0x0000000003953366 SignalHandler(int) (/path/to/swift/bin/swift+0x3953366)
2 0x00007f1845c073e0 __restore_rt (/lib/x86_64-linux-gnu/libpthread.so.0+0x113e0)
3 0x00000000014dc874 swift::TypeBase::getCanonicalType() (/path/to/swift/bin/swift+0x14dc874)
4 0x00000000014dcbf4 swift::TypeBase::getCanonicalType() (/path/to/swift/bin/swift+0x14dcbf4)
5 0x00000000013abf00 (anonymous namespace)::FindCapturedVars::checkType(swift::Type, swift::SourceLoc) (/path/to/swift/bin/swift+0x13abf00)
6 0x00000000013ac36a (anonymous namespace)::FindCapturedVars::walkToExprPre(swift::Expr*) (/path/to/swift/bin/swift+0x13ac36a)
7 0x000000000143f40e swift::ASTVisitor<(anonymous namespace)::Traversal, swift::Expr*, swift::Stmt*, bool, swift::Pattern*, bool, void>::visit(swift::Expr*) (/path/to/swift/bin/swift+0x143f40e)
8 0x000000000143e06b swift::Expr::walk(swift::ASTWalker&) (/path/to/swift/bin/swift+0x143e06b)
9 0x00000000013ad380 (anonymous namespace)::FindCapturedVars::walkToDeclPre(swift::Decl*) (/path/to/swift/bin/swift+0x13ad380)
10 0x000000000143e564 (anonymous namespace)::Traversal::doIt(swift::Decl*) (/path/to/swift/bin/swift+0x143e564)
11 0x0000000001443c44 (anonymous namespace)::Traversal::visitNominalTypeDecl(swift::NominalTypeDecl*) (/path/to/swift/bin/swift+0x1443c44)
12 0x000000000143e5b4 (anonymous namespace)::Traversal::doIt(swift::Decl*) (/path/to/swift/bin/swift+0x143e5b4)
13 0x0000000001441908 swift::ASTVisitor<(anonymous namespace)::Traversal, swift::Expr*, swift::Stmt*, bool, swift::Pattern*, bool, void>::visit(swift::Stmt*) (/path/to/swift/bin/swift+0x1441908)
14 0x000000000143e0ee swift::Stmt::walk(swift::ASTWalker&) (/path/to/swift/bin/swift+0x143e0ee)
15 0x00000000013ab111 swift::TypeChecker::computeCaptures(swift::AnyFunctionRef) (/path/to/swift/bin/swift+0x13ab111)
16 0x00000000013165db typeCheckFunctionsAndExternalDecls(swift::TypeChecker&) (/path/to/swift/bin/swift+0x13165db)
17 0x0000000001316e18 swift::performTypeChecking(swift::SourceFile&, swift::TopLevelContext&, swift::OptionSet<swift::TypeCheckingFlags, unsigned int>, unsigned int, unsigned int) (/path/to/swift/bin/swift+0x1316e18)
18 0x0000000000f871f6 swift::CompilerInstance::performSema() (/path/to/swift/bin/swift+0xf871f6)
19 0x00000000004a7136 swift::performFrontend(llvm::ArrayRef<char const*>, char const*, void*, swift::FrontendObserver*) (/path/to/swift/bin/swift+0x4a7136)
20 0x0000000000465257 main (/path/to/swift/bin/swift+0x465257)
21 0x00007f1844118830 __libc_start_main /build/glibc-Qz8a69/glibc-2.23/csu/../csu/libc-start.c:325:0
22 0x00000000004628f9 _start (/path/to/swift/bin/swift+0x4628f9)
```
2017-03-14 05:14:01 +01:00
swift-ci
15431e9bcd
Merge pull request #8064 from practicalswift/swiftc-28719-currentconstraintsolverarena-no-constraint-solver-active
2017-03-13 21:11:37 -07:00
Robert Widmann
1367b0cb36
Invalidate default argument exprs if typechecking fails
...
If typechecking fails, the expression will have unsolved type variables
written into it. This Crashes The Compiler.
In that case, there’s no reason to keep a tree of dangling references
around. Detach the initializer expression from the AST, but continue
to typecheck it to see if we can get some useful diagnostics out of it.
2017-03-13 23:27:02 -04:00
practicalswift
e3d7ff954e
[swiftc (74 vs. 5456)] Add crasher in swift::MetatypeType::get
...
Add test case for crash triggered in `swift::MetatypeType::get`.
Current number of unresolved compiler crashers: 74 (5456 resolved)
/cc @DougGregor - just wanted to let you know that this crasher caused an assertion failure for the assertion `CurrentConstraintSolverArena && "No constraint solver active?"` added on 2012-11-14 by you in commit 2183b57fa :-)
Assertion failure in [`lib/AST/ASTContext.cpp (line 362)`](8c0e9d5525/lib/AST/ASTContext.cpp (L362) ):
```
Assertion `CurrentConstraintSolverArena && "No constraint solver active?"' failed.
When executing: swift::ASTContext::Implementation::Arena &swift::ASTContext::Implementation::getArena(swift::AllocationArena)
```
Assertion context:
```c++
switch (arena) {
case AllocationArena::Permanent:
return Permanent;
case AllocationArena::ConstraintSolver:
assert(CurrentConstraintSolverArena && "No constraint solver active?");
return *CurrentConstraintSolverArena;
}
llvm_unreachable("bad AllocationArena");
}
```
Stack trace:
```
0 0x0000000003952c28 llvm::sys::PrintStackTrace(llvm::raw_ostream&) (/path/to/swift/bin/swift+0x3952c28)
1 0x0000000003953366 SignalHandler(int) (/path/to/swift/bin/swift+0x3953366)
2 0x00007f546eb8a3e0 __restore_rt (/lib/x86_64-linux-gnu/libpthread.so.0+0x113e0)
3 0x00007f546d0b0428 gsignal /build/glibc-Qz8a69/glibc-2.23/signal/../sysdeps/unix/sysv/linux/raise.c:54:0
4 0x00007f546d0b202a abort /build/glibc-Qz8a69/glibc-2.23/stdlib/abort.c:91:0
5 0x00007f546d0a8bd7 __assert_fail_base /build/glibc-Qz8a69/glibc-2.23/assert/assert.c:92:0
6 0x00007f546d0a8c82 (/lib/x86_64-linux-gnu/libc.so.6+0x2dc82)
7 0x00000000013c93ca swift::MetatypeType::get(swift::Type, llvm::Optional<swift::MetatypeRepresentation>, swift::ASTContext const&) (/path/to/swift/bin/swift+0x13c93ca)
8 0x00000000014dd051 swift::TypeBase::getCanonicalType() (/path/to/swift/bin/swift+0x14dd051)
9 0x00000000013abf00 (anonymous namespace)::FindCapturedVars::checkType(swift::Type, swift::SourceLoc) (/path/to/swift/bin/swift+0x13abf00)
10 0x00000000013ac36a (anonymous namespace)::FindCapturedVars::walkToExprPre(swift::Expr*) (/path/to/swift/bin/swift+0x13ac36a)
11 0x000000000143f40e swift::ASTVisitor<(anonymous namespace)::Traversal, swift::Expr*, swift::Stmt*, bool, swift::Pattern*, bool, void>::visit(swift::Expr*) (/path/to/swift/bin/swift+0x143f40e)
12 0x000000000143e06b swift::Expr::walk(swift::ASTWalker&) (/path/to/swift/bin/swift+0x143e06b)
13 0x00000000013ad380 (anonymous namespace)::FindCapturedVars::walkToDeclPre(swift::Decl*) (/path/to/swift/bin/swift+0x13ad380)
14 0x000000000143e564 (anonymous namespace)::Traversal::doIt(swift::Decl*) (/path/to/swift/bin/swift+0x143e564)
15 0x0000000001441908 swift::ASTVisitor<(anonymous namespace)::Traversal, swift::Expr*, swift::Stmt*, bool, swift::Pattern*, bool, void>::visit(swift::Stmt*) (/path/to/swift/bin/swift+0x1441908)
16 0x000000000143e0ee swift::Stmt::walk(swift::ASTWalker&) (/path/to/swift/bin/swift+0x143e0ee)
17 0x00000000013ab111 swift::TypeChecker::computeCaptures(swift::AnyFunctionRef) (/path/to/swift/bin/swift+0x13ab111)
18 0x00000000013165db typeCheckFunctionsAndExternalDecls(swift::TypeChecker&) (/path/to/swift/bin/swift+0x13165db)
19 0x0000000001316e18 swift::performTypeChecking(swift::SourceFile&, swift::TopLevelContext&, swift::OptionSet<swift::TypeCheckingFlags, unsigned int>, unsigned int, unsigned int) (/path/to/swift/bin/swift+0x1316e18)
20 0x0000000000f871f6 swift::CompilerInstance::performSema() (/path/to/swift/bin/swift+0xf871f6)
21 0x00000000004a7136 swift::performFrontend(llvm::ArrayRef<char const*>, char const*, void*, swift::FrontendObserver*) (/path/to/swift/bin/swift+0x4a7136)
22 0x0000000000465257 main (/path/to/swift/bin/swift+0x465257)
23 0x00007f546d09b830 __libc_start_main /build/glibc-Qz8a69/glibc-2.23/csu/../csu/libc-start.c:325:0
24 0x00000000004628f9 _start (/path/to/swift/bin/swift+0x4628f9)
```
2017-03-14 04:02:04 +01:00