Skip to content

Commit 60e7116

Browse files
[swiftc] Add test case for crash triggered in swift::constraints::ConstraintSystem::simplifyConstructionConstraint(swift::Type, swift::FunctionType*, unsigned int, swift::constraints::ConstraintLocator*)
Stack trace: ``` 6 swift 0x000000000329039d llvm::llvm_unreachable_internal(char const*, char const*, unsigned int) + 461 7 swift 0x0000000000f8d857 swift::constraints::ConstraintSystem::simplifyConstructionConstraint(swift::Type, swift::FunctionType*, unsigned int, swift::constraints::ConstraintLocator*) + 1303 8 swift 0x0000000000f91a05 swift::constraints::ConstraintSystem::simplifyApplicableFnConstraint(swift::constraints::Constraint const&) + 901 9 swift 0x0000000000f920a6 swift::constraints::ConstraintSystem::simplifyConstraint(swift::constraints::Constraint const&) + 854 10 swift 0x0000000000f26937 swift::constraints::ConstraintSystem::addConstraint(swift::constraints::Constraint*, bool, bool) + 23 13 swift 0x000000000104e7f5 swift::Expr::walk(swift::ASTWalker&) + 69 14 swift 0x0000000000f6e158 swift::constraints::ConstraintSystem::generateConstraints(swift::Expr*) + 200 15 swift 0x0000000000e87835 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>) + 245 16 swift 0x0000000000e8e172 swift::TypeChecker::typeCheckExpression(swift::Expr*&, swift::DeclContext*, swift::TypeLoc, swift::ContextualTypePurpose, swift::OptionSet<swift::TypeCheckExprFlags, unsigned int>, swift::ExprTypeCheckListener*) + 610 17 swift 0x0000000000e8f2c7 swift::TypeChecker::typeCheckBinding(swift::Pattern*&, swift::Expr*&, swift::DeclContext*) + 343 18 swift 0x0000000000e8f4db swift::TypeChecker::typeCheckPatternBinding(swift::PatternBindingDecl*, unsigned int) + 267 23 swift 0x0000000000ea0566 swift::TypeChecker::typeCheckDecl(swift::Decl*, bool) + 150 24 swift 0x0000000000ec3812 swift::performTypeChecking(swift::SourceFile&, swift::TopLevelContext&, swift::OptionSet<swift::TypeCheckingFlags, unsigned int>, unsigned int, unsigned int) + 994 25 swift 0x0000000000c585e9 swift::CompilerInstance::performSema() + 3289 27 swift 0x00000000007d6f4f swift::performFrontend(llvm::ArrayRef<char const*>, char const*, void*, swift::FrontendObserver*) + 2863 28 swift 0x00000000007a2f58 main + 2872 Stack dump: 0. Program arguments: /path/to/swift/bin/swift -frontend -c -primary-file validation-test/compiler_crashers/28301-swift-constraints-constraintsystem-simplifyconstructionconstraint.swift -target x86_64-unknown-linux-gnu -disable-objc-interop -module-name main -o /tmp/28301-swift-constraints-constraintsystem-simplifyconstructionconstraint-0fec68.o 1. While type-checking 'n' at validation-test/compiler_crashers/28301-swift-constraints-constraintsystem-simplifyconstructionconstraint.swift:9:1 2. While type-checking expression at [validation-test/compiler_crashers/28301-swift-constraints-constraintsystem-simplifyconstructionconstraint.swift:9:48 - line:9:49] RangeText="d{" <unknown>:0: error: unable to execute command: Aborted <unknown>:0: error: compile command failed due to signal (use -v to see invocation) ```
1 parent a98068f commit 60e7116

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
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+
class n{var d={}class A typealias d<T>:A let a=d{

0 commit comments

Comments
 (0)