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-5836] Compilation crash in Dictionary extension #48406

Closed
jlukas opened this issue Sep 4, 2017 · 4 comments
Closed

[SR-5836] Compilation crash in Dictionary extension #48406

jlukas opened this issue Sep 4, 2017 · 4 comments
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

@jlukas
Copy link

jlukas commented Sep 4, 2017

Previous ID SR-5836
Radar rdar://problem/34259886
Original Reporter @jlukas
Type Bug
Status Resolved
Resolution Done
Environment

Apple Swift version 4.0 (swiftlang-900.0.63.10 clang-900.0.36)

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

md5: b156cf3bcf7a4c66c58b83a54c3dae1b

is duplicated by:

  • SR-5932 Segmentation fault: 11 when creating a Set of optionals

Issue Description:

I'm not sure what exactly is causing the crash, but I reduced it this far:

Input:

extension Dictionary {
    func doSomething<T>() -> [T:Value] {
        let pairs: [(T,Value)] = []
        return Dictionary(uniqueKeysWithValues: pairs)
    }
}

Output:

Stack dump:
0.  While emitting SIL for 'doSomething()' at /var/folders/my/75k1c85j1s5fj3myg_4x273r0000gn/T/repl1-bcce9c..swift:2:5
@belkadan
Copy link
Contributor

belkadan commented Sep 5, 2017

Huh. Looks like this was working in 900.0.54.11 and then we broke it again. @rudkx, @xedin?

@rudkx
Copy link
Member

rudkx commented Sep 5, 2017

@swift-ci create

@rudkx
Copy link
Member

rudkx commented Sep 5, 2017

I opened a PR to add this test to our test suite: #11773

If the code is updated to return [Key : Value] rather than [T : Value] and create an array of (Key, Value) pairs rather than (T, Value) pairs, we don't crash. Apparently there was a reason to make this generic on a new type in the original code this was reduced from, though.

@slavapestov
Copy link
Member

#12150

@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

5 participants