Skip to content

Commit bc0d7b5

Browse files
[swiftc] Add crash triggered in swift::DeclContext::isCascadingContextForLookup(bool) const. Bumps # of unresolved crash cases to 92.
Stack trace: ``` 4 swift 0x00000000010c2e67 swift::DeclContext::isCascadingContextForLookup(bool) const + 7 5 swift 0x00000000010c2e87 swift::DeclContext::isCascadingContextForLookup(bool) const + 39 6 swift 0x00000000010c2e87 swift::DeclContext::isCascadingContextForLookup(bool) const + 39 9 swift 0x0000000000f0e6de swift::TypeChecker::resolveIdentifierType(swift::DeclContext*, swift::IdentTypeRepr*, swift::OptionSet<swift::TypeResolutionFlags, unsigned int>, bool, swift::GenericTypeResolver*, llvm::function_ref<bool (swift::TypeCheckRequest)>*) + 158 11 swift 0x0000000000f0f7b4 swift::TypeChecker::resolveType(swift::TypeRepr*, swift::DeclContext*, swift::OptionSet<swift::TypeResolutionFlags, unsigned int>, swift::GenericTypeResolver*, llvm::function_ref<bool (swift::TypeCheckRequest)>*) + 164 12 swift 0x0000000000f0e5d0 swift::TypeChecker::validateType(swift::TypeLoc&, swift::DeclContext*, swift::OptionSet<swift::TypeResolutionFlags, unsigned int>, swift::GenericTypeResolver*, llvm::function_ref<bool (swift::TypeCheckRequest)>*) + 192 13 swift 0x0000000000eda0e2 swift::TypeChecker::checkGenericParamList(swift::ArchetypeBuilder*, swift::GenericParamList*, swift::GenericSignature*, bool, swift::GenericTypeResolver*) + 690 14 swift 0x0000000000edb6a7 swift::TypeChecker::validateGenericSignature(swift::GenericParamList*, swift::DeclContext*, swift::GenericSignature*, std::function<bool (swift::ArchetypeBuilder&)>, bool&) + 135 15 swift 0x0000000000edba46 swift::TypeChecker::validateGenericTypeSignature(swift::GenericTypeDecl*) + 102 16 swift 0x0000000000e9c90f swift::TypeChecker::validateDecl(swift::ValueDecl*, bool) + 367 20 swift 0x0000000000f0e6de swift::TypeChecker::resolveIdentifierType(swift::DeclContext*, swift::IdentTypeRepr*, swift::OptionSet<swift::TypeResolutionFlags, unsigned int>, bool, swift::GenericTypeResolver*, llvm::function_ref<bool (swift::TypeCheckRequest)>*) + 158 22 swift 0x0000000000f0f7b4 swift::TypeChecker::resolveType(swift::TypeRepr*, swift::DeclContext*, swift::OptionSet<swift::TypeResolutionFlags, unsigned int>, swift::GenericTypeResolver*, llvm::function_ref<bool (swift::TypeCheckRequest)>*) + 164 23 swift 0x0000000000f0e5d0 swift::TypeChecker::validateType(swift::TypeLoc&, swift::DeclContext*, swift::OptionSet<swift::TypeResolutionFlags, unsigned int>, swift::GenericTypeResolver*, llvm::function_ref<bool (swift::TypeCheckRequest)>*) + 192 24 swift 0x0000000000ee1527 swift::TypeChecker::typeCheckPattern(swift::Pattern*, swift::DeclContext*, swift::OptionSet<swift::TypeResolutionFlags, unsigned int>, swift::GenericTypeResolver*) + 967 29 swift 0x0000000000ea2156 swift::TypeChecker::typeCheckDecl(swift::Decl*, bool) + 150 32 swift 0x0000000000f0757a swift::TypeChecker::typeCheckFunctionBodyUntil(swift::FuncDecl*, swift::SourceLoc) + 346 33 swift 0x0000000000f073de swift::TypeChecker::typeCheckAbstractFunctionBodyUntil(swift::AbstractFunctionDecl*, swift::SourceLoc) + 46 34 swift 0x0000000000f07fa3 swift::TypeChecker::typeCheckAbstractFunctionBody(swift::AbstractFunctionDecl*) + 179 36 swift 0x0000000000ec4c11 swift::performTypeChecking(swift::SourceFile&, swift::TopLevelContext&, swift::OptionSet<swift::TypeCheckingFlags, unsigned int>, unsigned int, unsigned int) + 1281 37 swift 0x0000000000c594c9 swift::CompilerInstance::performSema() + 3289 39 swift 0x00000000007d7739 swift::performFrontend(llvm::ArrayRef<char const*>, char const*, void*, swift::FrontendObserver*) + 2857 40 swift 0x00000000007a3748 main + 2872 Stack dump: 0. Program arguments: /path/to/swift/bin/swift -frontend -c -primary-file validation-test/compiler_crashers/28315-swift-declcontext-iscascadingcontextforlookup.swift -target x86_64-unknown-linux-gnu -disable-objc-interop -module-name main -o /tmp/28315-swift-declcontext-iscascadingcontextforlookup-e789e8.o 1. While type-checking 'g' at validation-test/compiler_crashers/28315-swift-declcontext-iscascadingcontextforlookup.swift:31:1 2. While type-checking 'b' at validation-test/compiler_crashers/28315-swift-declcontext-iscascadingcontextforlookup.swift:72:9 3. While resolving type a at [validation-test/compiler_crashers/28315-swift-declcontext-iscascadingcontextforlookup.swift:152:5 - line:152:5] RangeText="a" 4. While resolving type g at [validation-test/compiler_crashers/28315-swift-declcontext-iscascadingcontextforlookup.swift:157:15 - line:157:15] RangeText="g" <unknown>:0: error: unable to execute command: Segmentation fault <unknown>:0: error: compile command failed due to signal (use -v to see invocation) ```
1 parent 78c04e2 commit bc0d7b5

File tree

1 file changed

+157
-0
lines changed

1 file changed

+157
-0
lines changed
Lines changed: 157 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,157 @@
1+
// This source file is part of the Swift.org open source project
2+
// Copyright (c) 2014 - 2016 Apple Inc. and the Swift project authors
3+
// Licensed under Apache License v2.0 with Runtime Library Exception
4+
//
5+
// See http://swift.org/LICENSE.txt for license information
6+
// See http://swift.org/CONTRIBUTORS.txt for the list of Swift project authors
7+
8+
// RUN: not --crash %target-swift-frontend %s -parse
9+
=b<T=class B
10+
}{
11+
func b{enum B:T=(a
12+
class
13+
class
14+
struct B:B{
15+
class S<b<b{
16+
struct B{
17+
func a=b{enum B{for c
18+
var e
19+
class
20+
case c
21+
struct c
22+
class A{map(a<T.c
23+
let a{typealias e{struct c<T.E
24+
func^(f.c<f:B:O{
25+
"
26+
func^
27+
let a{
28+
{
29+
if true{
30+
"
31+
func g:O{typealias f
32+
let : Int -> ($0
33+
if true{struct Q<b<T=Swift.E=e
34+
case c<f:T:O{[]as a{
35+
func a=e== {struct c<T where g:f:O{enum b
36+
protocol B{
37+
func g:T:O{enum B:O{
38+
"
39+
=e
40+
if true{
41+
{
42+
var e
43+
{func b
44+
struct c
45+
let:a=e{
46+
protocol B
47+
struct B:T=b<T where H : Boole
48+
func^(f: Int -> ($0
49+
protocol B:a{
50+
class A{typealias f
51+
func g:B
52+
func a!
53+
class b
54+
}
55+
let a
56+
struct c<h{
57+
let:B{
58+
struct Q<T where T>
59+
let a=class a {class S<h{struct Q<T>:B{enum B<h
60+
protocol a{enum b<>
61+
func g:T>:B:B{enum b{class c
62+
protocol A{
63+
let a{
64+
struct B{
65+
class b
66+
protocol B
67+
if true{protocol a{
68+
class c
69+
class b<T:a!
70+
struct B{enum b<T where g:O{
71+
"
72+
for c:a=class b{
73+
let:A
74+
if true{[]as a{enum b
75+
struct B{enum B{struct Q<T where I=(a
76+
protocol A:a
77+
protocol B
78+
case c
79+
func^(f
80+
if true{struct Q<>:d where H : Boole
81+
struct c
82+
}
83+
if true{func i(
84+
class A
85+
}class B
86+
case c
87+
struct Q<
88+
func a
89+
func^(a!
90+
struct c<
91+
struct c
92+
struct Q{enum B<T where T.c<T where I=c
93+
struct A{enum b{
94+
let:T.c
95+
if true{
96+
protocol a=e==class b{
97+
func g:T:T.E=c
98+
let : Boole
99+
if case{
100+
{
101+
{
102+
struct S{map(f: C {func < {class B{struct c
103+
func b
104+
var b<f: C {
105+
func < {{
106+
class A{
107+
struct c<h
108+
protocol B<T.E
109+
{
110+
protocol B:B:B
111+
let:T:a{
112+
protocol B{struct c
113+
let a!
114+
class S<T where H : Boole
115+
struct c:{class a {
116+
func g:B<T where I=e
117+
if true{extension{
118+
{
119+
{for c<f: Int -> (a{
120+
struct c<T where g:B:B:A{typealias f: C {enum B:O{for c
121+
struct Q{enum b<T where g:B:a!
122+
struct c,case{struct Q{struct Q{}
123+
struct Q{
124+
{func < {
125+
{protocol B{
126+
}
127+
protocol A
128+
case c<a
129+
if true{struct Q<T where g:B:f:a!
130+
var b{case
131+
}
132+
struct c<T=c,
133+
}
134+
{class B:a{
135+
var b<T:B<T where I==e{enum b{class b{struct Q<T where I=e=class A
136+
func b
137+
struct c<>:b<>
138+
protocol B<T.c
139+
import a{struct S{
140+
let:T=b
141+
protocol a=e=c<T where B<T.E=class B{
142+
class b<T where I=e{enum B{
143+
case c<T where H : Int -> (f
144+
}
145+
if true{
146+
struct Q<h
147+
let:a
148+
protocol A{extension{
149+
class b{enum B{typealias e
150+
"
151+
struct c
152+
let:a
153+
}
154+
struct Q{
155+
}
156+
import a
157+
class a where g:B

0 commit comments

Comments
 (0)