Skip to content

[+0-normal-args] Change flattenOptional to use switch_enum instead of… #15162

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

Conversation

gottesmm
Copy link
Contributor

… select_enum+cond_br.

Along the .none path, select_enum+cond_br causes the ownership verifier to
trigger since the .none path looks like a leak. By using a switch_enum, we avoid
this problem since the ownership verifier thinks the switch_enum consumes the
input value and views the owned value along the .some path as a value with
separate ownership.

rdar://34222540

… select_enum+cond_br.

Along the .none path, select_enum+cond_br causes the ownership verifier to
trigger since the .none path looks like a leak. By using a switch_enum, we avoid
this problem since the ownership verifier thinks the switch_enum consumes the
input value and views the owned value along the .some path as a value with
separate ownership.

rdar://34222540
@gottesmm
Copy link
Contributor Author

@swift-ci smoke test

@gottesmm
Copy link
Contributor Author

I have a test case for this in the plus_zero tests.

@gottesmm gottesmm merged commit 29235bb into swiftlang:master Mar 11, 2018
@gottesmm gottesmm deleted the pr-c7ce5aaffe4cdb5dde04b8a1626a5379fd122354 branch March 11, 2018 20:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant