Skip to content

[Statement checking] Fix "old" fallthrough source. #33730

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

Merged
merged 1 commit into from
Sep 1, 2020

Conversation

DougGregor
Copy link
Member

Fallthrough statement sources have always been incorrectly computed
when there are nested switch statements. The recent refactoring to
switch fallthrough source/destination computation over to ASTScope
fixed the computation. Amusingly, the assertion that ensures that the
old and new implementations produce the same result fires on these
cases, but it's the old implementation that's wrong. Fix up the old
implementation so the assertion does not trigger. The new test case
crashes in Swift 5.3 and earlier, asserts prior to this change.

Fixes rdar://problem/67704651.

Fallthrough statement sources have always been incorrectly computed
when there are nested switch statements. The recent refactoring to
switch fallthrough source/destination computation over to ASTScope
fixed the computation. Amusingly, the assertion that ensures that the
old and new implementations produce the same result fires on these
cases, but it's the old implementation that's wrong. Fix up the old
implementation so the assertion does not trigger. The new test case
crashes in Swift 5.3 and earlier, asserts prior to this change.

Fixes rdar://problem/67704651.
@DougGregor
Copy link
Member Author

@swift-ci smoke test and merge

@swift-ci swift-ci merged commit f31bc63 into swiftlang:master Sep 1, 2020
@DougGregor DougGregor deleted the fallthrough-nested branch September 1, 2020 04:12
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.

2 participants