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

[4.0] SILGen: Remove unused catch block for a try? expr using SGF.eraseBasicBlock(). #11009

Merged
merged 1 commit into from Jul 18, 2017

Conversation

jckarter
Copy link
Member

Explanation: A try? expression that didn't include any throwing in its subexpression would corrupt SILGen's internal state, leading to compiler crashes.

Scope of issue: Because it's an internal consistency issue, some code that happened to seem to work with Swift 3.1 releases will now crash in 4.0 builds, leading to regressions.

Issue: SR-1333, rdar://problem/33351098

Risk: Low, one-line bug fix

Testing: Swift CI, test cases from Jira

…cBlock().

Erasing the block directly from its parent using bb->eraseFromParent() doesn't update SILGenFunction's internal state tracking the postmatter section of the function. Fixes SR-1333 | rdar://problem/33351098.
@jckarter
Copy link
Member Author

@swift-ci Please test source compatibility

@jckarter
Copy link
Member Author

@swift-ci Please test

@jckarter
Copy link
Member Author

@rjmccall Mind reviewing this for the 4.0 branch? Got any ideas on how we can more proactively prevent this mistake?

@jckarter jckarter requested a review from rjmccall July 17, 2017 19:02
@slavapestov
Copy link
Member

LGTM.

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.

None yet

2 participants