Skip to content

Commit bc208f5

Browse files
[swiftc] Add 💥 case (😢 → 56, 😀 → 5096) triggered in swift::irgen::IRGenModule::emitSILFunction(…)
Add crash case with stack trace: ``` swift: /path/to/swift/lib/IRGen/GenType.cpp:84: swift::irgen::Address swift::irgen::TypeInfo::getAddressForPointer(llvm::Value *) const: Assertion `ptr->getType()->getPointerElementType() == StorageType' failed. 11 swift 0x00000000008af5e9 swift::irgen::IRGenModule::emitSILFunction(swift::SILFunction*) + 1241 12 swift 0x000000000080d028 swift::irgen::IRGenerator::emitGlobalTopLevel() + 408 14 swift 0x00000000007e6954 swift::performIRGeneration(swift::IRGenOptions&, swift::SourceFile&, swift::SILModule*, llvm::StringRef, llvm::LLVMContext&, unsigned int) + 68 16 swift 0x00000000007d82c9 swift::performFrontend(llvm::ArrayRef<char const*>, char const*, void*, swift::FrontendObserver*) + 2857 17 swift 0x00000000007a4308 main + 2872 Stack dump: 0. Program arguments: /path/to/swift/bin/swift -frontend -c -primary-file validation-test/compiler_crashers/28342-getpointerelementtype-is-not-storagetype.swift -target x86_64-unknown-linux-gnu -disable-objc-interop -module-name main -o /tmp/28342-getpointerelementtype-is-not-storagetype-7b6cf1.o 1. While emitting IR SIL function @_TTWV4main1HS_1ES_FS1_1guRd__S_1Awx1Fzwd__1BrfGVS_1Cqd___T_ for 'g' at validation-test/compiler_crashers/28342-getpointerelementtype-is-not-storagetype.swift:22:5 <unknown>:0: error: unable to execute command: Aborted <unknown>:0: error: compile command failed due to signal (use -v to see invocation) ```
1 parent b050f66 commit bc208f5

File tree

1 file changed

+23
-0
lines changed

1 file changed

+23
-0
lines changed
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
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-silgen
9+
// REQUIRES: asserts
10+
protocol A {
11+
associatedtype B
12+
}
13+
struct C<T: A> {
14+
let d: T
15+
}
16+
protocol E {
17+
associatedtype F
18+
func g<T where F == T.B>(_: C<T>)
19+
}
20+
struct H: E {
21+
typealias F = Void
22+
func g<T where F == T.B>(_: C<T>) {}
23+
}

0 commit comments

Comments
 (0)