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-78] swiftc crushed for very simple code #42700

Closed
swift-ci opened this issue Dec 5, 2015 · 3 comments
Closed

[SR-78] swiftc crushed for very simple code #42700

swift-ci opened this issue Dec 5, 2015 · 3 comments
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

@swift-ci
Copy link
Collaborator

swift-ci commented Dec 5, 2015

Previous ID SR-78
Radar None
Original Reporter windoze (JIRA User)
Type Bug
Status Resolved
Resolution Done

Attachment: Download

Environment

Ubuntu 14.04.3 LTS x86_64, Ubuntu 14.04 Swift 2.2 Snapshot

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

md5: 4ce09acd58663f0925c8dc1bdf749fe1

Issue Description:

Following piece of code effectively crushes swiftc

struct A<T1, T2> {
    var f:B<T1, T2>
    var b:B<T2, T1>
    var v:T1
}
struct B<T1, T2> {}

Logs attached

@tachyonics
Copy link

Hi,

I decided to take a look at this bug so I could start getting familiar with the codebase.

I was able to reproduce the bug both on the command line and Xcode. Digging into it, it looks like this issue is caused by the code trying to increment an exhausted iterator - if I understand correctly in the case where B doesn't have any properties (so there is an iterator that starts out exhausted).

I have verified that handling the case of an exhausted iterator so the code doesn't try to increment it allows your code to compile.

I will look to add a unit test for this use case to verify that it now works as expected and then submit a pull request.

@swift-ci
Copy link
Collaborator Author

swift-ci commented Dec 7, 2015

Comment by Manav Gabhawala (JIRA)

Fixed with pull request: #293

@jckarter
Copy link
Member

jckarter commented Dec 7, 2015

Fixed in #293.

@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