Skip to content

Commit ddd457c

Browse files
[swiftc] Add test case for crash triggered in swift::TypeChecker::checkGenericParamList(swift::ArchetypeBuilder*, swift::GenericParamList*, swift::GenericSignature*, bool, swift::GenericTypeResolver*)
Stack trace: ``` 4 swift 0x0000000000ed9e0a swift::TypeChecker::checkGenericParamList(swift::ArchetypeBuilder*, swift::GenericParamList*, swift::GenericSignature*, bool, swift::GenericTypeResolver*) + 74 5 swift 0x0000000000edb637 swift::TypeChecker::validateGenericSignature(swift::GenericParamList*, swift::DeclContext*, swift::GenericSignature*, std::function<bool (swift::ArchetypeBuilder&)>, bool&) + 135 6 swift 0x0000000000edb9d6 swift::TypeChecker::validateGenericTypeSignature(swift::GenericTypeDecl*) + 102 7 swift 0x0000000000e9c94f swift::TypeChecker::validateDecl(swift::ValueDecl*, bool) + 367 12 swift 0x0000000000ea2166 swift::TypeChecker::typeCheckDecl(swift::Decl*, bool) + 150 13 swift 0x0000000000ec4ac2 swift::performTypeChecking(swift::SourceFile&, swift::TopLevelContext&, swift::OptionSet<swift::TypeCheckingFlags, unsigned int>, unsigned int, unsigned int) + 1026 14 swift 0x0000000000c58d39 swift::CompilerInstance::performSema() + 3289 16 swift 0x00000000007d73bf swift::performFrontend(llvm::ArrayRef<char const*>, char const*, void*, swift::FrontendObserver*) + 2863 17 swift 0x00000000007a33d8 main + 2872 Stack dump: 0. Program arguments: /path/to/swift/bin/swift -frontend -c -primary-file validation-test/compiler_crashers/28308-swift-typechecker-checkgenericparamlist.swift -target x86_64-unknown-linux-gnu -disable-objc-interop -module-name main -o /tmp/28308-swift-typechecker-checkgenericparamlist-b4f9c8.o 1. While type-checking 'B' at validation-test/compiler_crashers/28308-swift-typechecker-checkgenericparamlist.swift:9:1 <unknown>:0: error: unable to execute command: Segmentation fault <unknown>:0: error: compile command failed due to signal (use -v to see invocation) ```
1 parent da8b300 commit ddd457c

File tree

1 file changed

+71
-0
lines changed

1 file changed

+71
-0
lines changed
Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
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+
struct B<b where T>{{return"class A<b protocol b{
10+
func<b {
11+
func g:BooleanType
12+
struct B{
13+
class A.
14+
struct B{n C{struct B:A<d where f={
15+
{}struct b: A.h: T where g:b{let l=c<d where B{class B<T where k:a()class A{let:A{
16+
class B{
17+
{
18+
{
19+
let a{
20+
if true {class c
21+
class B:a{
22+
let a{let e{let e=b
23+
{
24+
struct c {
25+
if{
26+
class b
27+
struct B:e
28+
if true {}
29+
{
30+
{func a(){{let l=b
31+
import Foundation
32+
if{
33+
enum S<T where k:A{
34+
var f{let a=b where B<T : A{
35+
import Foundation
36+
class A.h:BooleanType
37+
func c
38+
{
39+
let t:b)class g:e
40+
func a{struct S{class c<T where B:a{let:A{
41+
class B{let a {n C{class B<T where k:b)class a(){
42+
func a{func c{
43+
if true {let a(){n C{var f.
44+
{}
45+
import c<T:A.h:b
46+
enum S<b where T:b{
47+
{
48+
class a{
49+
struct g {class A{
50+
{
51+
class A{
52+
func c
53+
let a=b where f={{class B<h
54+
{let a={
55+
var f=b){class b
56+
{e f=i[where[{struct B<b
57+
{struct
58+
if true{struct B<T where h:a{}
59+
class b{let a{
60+
enum S{
61+
var f.
62+
class B<T where T:d
63+
class A{
64+
{
65+
if true {
66+
{
67+
class g:a
68+
import c
69+
class B<T where g:d
70+
typealias F=bhere k:A{return"class B<b
71+
enum b where B:BooleanType

0 commit comments

Comments
 (0)