Skip to content

Commit 7c3855f

Browse files
[swiftc (100 vs. 5181)] Add crasher in swift::ASTVisitor
Add test case for crash triggered in `swift::ASTVisitor`. Current number of unresolved compiler crashers: 100 (5181 resolved) Stack trace: ``` a type variable escaped the type checker#0 0x00000000031d08f8 llvm::sys::PrintStackTrace(llvm::raw_ostream&) (/path/to/swift/bin/swift+0x31d08f8) #1 0x00000000031d1146 SignalHandler(int) (/path/to/swift/bin/swift+0x31d1146) #2 0x00007f96419b2330 __restore_rt (/lib/x86_64-linux-gnu/libpthread.so.0+0x10330) swiftlang#3 0x00007f9640170c37 gsignal /build/eglibc-oGUzwX/eglibc-2.19/signal/../nptl/sysdeps/unix/sysv/linux/raise.c:56:0 swiftlang#4 0x00007f9640174028 abort /build/eglibc-oGUzwX/eglibc-2.19/stdlib/abort.c:91:0 swiftlang#5 0x0000000000d5dc4c (anonymous namespace)::Verifier::verifyChecked(swift::Type, llvm::SmallPtrSet<swift::ArchetypeType*, 4u>&) (/path/to/swift/bin/swift+0xd5dc4c) swiftlang#6 0x0000000000d5092a (anonymous namespace)::Verifier::walkToExprPost(swift::Expr*) (/path/to/swift/bin/swift+0xd5092a) swiftlang#7 0x0000000000d6a7e4 (anonymous namespace)::Traversal::visit(swift::Expr*) (/path/to/swift/bin/swift+0xd6a7e4) swiftlang#8 0x0000000000d693aa swift::ASTVisitor<(anonymous namespace)::Traversal, swift::Expr*, swift::Stmt*, bool, swift::Pattern*, bool, void>::visit(swift::Stmt*) (/path/to/swift/bin/swift+0xd693aa) swiftlang#9 0x0000000000d6926c swift::ASTVisitor<(anonymous namespace)::Traversal, swift::Expr*, swift::Stmt*, bool, swift::Pattern*, bool, void>::visit(swift::Stmt*) (/path/to/swift/bin/swift+0xd6926c) swiftlang#10 0x0000000000d6c083 (anonymous namespace)::Traversal::visit(swift::Expr*) (/path/to/swift/bin/swift+0xd6c083) swiftlang#11 0x0000000000d6930f swift::ASTVisitor<(anonymous namespace)::Traversal, swift::Expr*, swift::Stmt*, bool, swift::Pattern*, bool, void>::visit(swift::Stmt*) (/path/to/swift/bin/swift+0xd6930f) swiftlang#12 0x0000000000d69586 swift::ASTVisitor<(anonymous namespace)::Traversal, swift::Expr*, swift::Stmt*, bool, swift::Pattern*, bool, void>::visit(swift::Stmt*) (/path/to/swift/bin/swift+0xd69586) swiftlang#13 0x0000000000d6926c swift::ASTVisitor<(anonymous namespace)::Traversal, swift::Expr*, swift::Stmt*, bool, swift::Pattern*, bool, void>::visit(swift::Stmt*) (/path/to/swift/bin/swift+0xd6926c) swiftlang#14 0x0000000000d67bae (anonymous namespace)::Traversal::doIt(swift::Decl*) (/path/to/swift/bin/swift+0xd67bae) swiftlang#15 0x0000000000d677c4 swift::Decl::walk(swift::ASTWalker&) (/path/to/swift/bin/swift+0xd677c4) swiftlang#16 0x0000000000dbccbe swift::SourceFile::walk(swift::ASTWalker&) (/path/to/swift/bin/swift+0xdbccbe) swiftlang#17 0x0000000000d4f3dc swift::verify(swift::SourceFile&) (/path/to/swift/bin/swift+0xd4f3dc) swiftlang#18 0x0000000000c15292 swift::performTypeChecking(swift::SourceFile&, swift::TopLevelContext&, swift::OptionSet<swift::TypeCheckingFlags, unsigned int>, unsigned int, unsigned int) (/path/to/swift/bin/swift+0xc15292) swiftlang#19 0x0000000000938136 swift::CompilerInstance::performSema() (/path/to/swift/bin/swift+0x938136) swiftlang#20 0x000000000047ece5 performCompile(swift::CompilerInstance&, swift::CompilerInvocation&, llvm::ArrayRef<char const*>, int&, swift::FrontendObserver*) (/path/to/swift/bin/swift+0x47ece5) swiftlang#21 0x000000000047db7f swift::performFrontend(llvm::ArrayRef<char const*>, char const*, void*, swift::FrontendObserver*) (/path/to/swift/bin/swift+0x47db7f) swiftlang#22 0x000000000044509a main (/path/to/swift/bin/swift+0x44509a) swiftlang#23 0x00007f964015bf45 __libc_start_main /build/eglibc-oGUzwX/eglibc-2.19/csu/libc-start.c:321:0 swiftlang#24 0x0000000000442816 _start (/path/to/swift/bin/swift+0x442816) ```
1 parent 3eab2dc commit 7c3855f

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
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 -emit-ir
9+
guard{{return $0
10+
== Int
11+
p

0 commit comments

Comments
 (0)