Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[SR-6664] Cannot switch on indirect enum with complex associated value #49213

Closed
beccadax opened this issue Dec 25, 2017 · 4 comments
Closed
Assignees
Labels
bug A deviation from expected or documented behavior. Also: expected but undesirable behavior. compiler The Swift compiler in itself crash Bug: A crash, i.e., an abnormal termination of software

Comments

@beccadax
Copy link
Contributor

Previous ID SR-6664
Radar rdar://problem/36256185
Original Reporter @beccadax
Type Bug
Status Closed
Resolution Done

Attachment: Download

Environment

Swift d6bbf81, macOS 10.13.1 (17B1003), clang-900.0.39.2

Additional Detail from JIRA
Votes 0
Component/s Compiler
Labels Bug, CompilerCrash
Assignee @gottesmm
Priority Medium

md5: 6e0ad998da4aed034e7a16c5929cb04b

Issue Description:

If you have an enum with a case like this:

indirect enum Base<Element> {
    case index((Int) -> Void, Element)
}

Compiling code which switches on this case fails an assertion with "-enable-sil-ownership":

Non trivial values, non address values, and non guaranteed function args must have at least one lifetime ending use?!
Value: %8 = load [take] %7 : $*@callee_guaranteed (Int) -> ()
triggering standard assertion failure routine
UNREACHABLE executed at /Users/brent/Documents/Code/CodeLibrary/swiftdev/swift/lib/SIL/SILOwnershipVerifier.cpp:1583!

A reduced test case and assertion output are attached.

@belkadan
Copy link
Contributor

belkadan commented Jan 2, 2018

@swift-ci create

@gottesmm
Copy link
Member

This was already fixed. I am committing a version of this test case to make sure that we do not crash here again.

@gottesmm
Copy link
Member

a49e3ad

@beccadax
Copy link
Contributor Author

The test LGTM, so if it passes, we're done here.

@swift-ci swift-ci transferred this issue from apple/swift-issues Apr 25, 2022
@AnthonyLatsis AnthonyLatsis added the crash Bug: A crash, i.e., an abnormal termination of software label Dec 12, 2022
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug A deviation from expected or documented behavior. Also: expected but undesirable behavior. compiler The Swift compiler in itself crash Bug: A crash, i.e., an abnormal termination of software
Projects
None yet
Development

No branches or pull requests

4 participants