Skip to content

Commit 5db8277

Browse files
[swiftc] Add test case for crash triggered in swift::Expr::walk(swift::ASTWalker&)
Stack trace: ``` swift: /path/to/llvm/include/llvm/ADT/Optional.h:138: T &&llvm::Optional<swift::constraints::SelectedOverload>::operator*() && [T = swift::constraints::SelectedOverload]: Assertion `hasVal' failed. 11 swift 0x0000000000fdfea5 swift::Expr::walk(swift::ASTWalker&) + 69 12 swift 0x0000000000ed3e26 swift::constraints::ConstraintSystem::applySolution(swift::constraints::Solution&, swift::Expr*, swift::Type, bool, bool, bool) + 502 13 swift 0x0000000000e36d5a swift::TypeChecker::typeCheckExpression(swift::Expr*&, swift::DeclContext*, swift::Type, swift::ContextualTypePurpose, swift::OptionSet<swift::TypeCheckExprFlags, unsigned int>, swift::ExprTypeCheckListener*) + 746 16 swift 0x0000000000ef093b swift::constraints::ConstraintSystem::diagnoseFailureForExpr(swift::Expr*) + 10971 17 swift 0x0000000000ef29a0 swift::constraints::ConstraintSystem::salvage(llvm::SmallVectorImpl<swift::constraints::Solution>&, swift::Expr*) + 4064 18 swift 0x0000000000e30803 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>) + 787 19 swift 0x0000000000e36cb0 swift::TypeChecker::typeCheckExpression(swift::Expr*&, swift::DeclContext*, swift::Type, swift::ContextualTypePurpose, swift::OptionSet<swift::TypeCheckExprFlags, unsigned int>, swift::ExprTypeCheckListener*) + 576 21 swift 0x0000000000ea8986 swift::TypeChecker::typeCheckTopLevelCodeDecl(swift::TopLevelCodeDecl*) + 134 22 swift 0x0000000000e6c27d swift::performTypeChecking(swift::SourceFile&, swift::TopLevelContext&, swift::OptionSet<swift::TypeCheckingFlags, unsigned int>, unsigned int) + 1149 23 swift 0x0000000000cbdccf swift::CompilerInstance::performSema() + 3087 25 swift 0x000000000078b89f frontend_main(llvm::ArrayRef<char const*>, char const*, void*) + 2495 26 swift 0x0000000000786365 main + 2837 Stack dump: 0. Program arguments: /path/to/swift/bin/swift -frontend -c -primary-file validation-test/compiler_crashers/28272-swift-expr-walk.swift -target x86_64-unknown-linux-gnu -disable-objc-interop -module-name main -o /tmp/28272-swift-expr-walk-29a7d7.o 1. While type-checking expression at [validation-test/compiler_crashers/28272-swift-expr-walk.swift:6:1 - line:6:3] RangeText=".A[" 2. While type-checking expression at [validation-test/compiler_crashers/28272-swift-expr-walk.swift:6:1 - line:6:3] RangeText=".A[" <unknown>:0: error: unable to execute command: Aborted <unknown>:0: error: compile command failed due to signal (use -v to see invocation) ```
1 parent f59b897 commit 5db8277

File tree

2 files changed

+14
-0
lines changed

2 files changed

+14
-0
lines changed

validation-test/compiler_crashers/28271-swift-archetypebuilder-getallarchetypes.swift

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
// 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+
//
25
// See http://swift.org/LICENSE.txt for license information
6+
// See http://swift.org/CONTRIBUTORS.txt for the list of Swift project authors
37

48
// RUN: not --crash %target-swift-frontend %s -parse
59
// REQUIRES: asserts
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
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+
// REQUIRES: asserts
10+
.A[

0 commit comments

Comments
 (0)