Skip to content

[5.5][AST] Return null type in AbstractClosureExpr::getResultType if getType is null #37362

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

Conversation

ahoppen
Copy link
Member

@ahoppen ahoppen commented May 11, 2021

Cherry-pick of #37341 into release/5.5

  • Explanation: If getType returns a null type, also return a null type in AbstractClosureExpr::getResultType. Previously, we were crashing.
  • Scope: Invalid code where the type checker fails to set a type on closure expressions
  • Risk: Very low
  • Testing: None, the fix was created based on a crash trace without a reproducer
  • Issue: rdar://77565983
  • Reviewer: Pavel Yaskevich (@xedin)

…getType` is `null`

If `getType` returns a `null` type, also return a `null` type in `AbstractClosureExpr::getResultType` instead of crashing.

Fixes rdar://77565983
@ahoppen ahoppen added the r5.5 label May 11, 2021
@ahoppen ahoppen requested a review from akyrtzi May 11, 2021 11:17
@ahoppen ahoppen requested a review from a team as a code owner May 11, 2021 11:17
@ahoppen
Copy link
Member Author

ahoppen commented May 11, 2021

@swift-ci Please test

@swift-ci
Copy link
Contributor

Build failed
Swift Test Linux Platform
Git Sha - 7bfcbfe

@swift-ci
Copy link
Contributor

Build failed
Swift Test OS X Platform
Git Sha - 7bfcbfe

@ahoppen
Copy link
Member Author

ahoppen commented May 12, 2021

@swift-ci Please test macOS

@ahoppen
Copy link
Member Author

ahoppen commented May 12, 2021

@swift-ci Please test Linux

@ahoppen
Copy link
Member Author

ahoppen commented May 12, 2021

@swift-ci Please nominate

@airspeedswift airspeedswift merged commit d8b06ae into swiftlang:release/5.5 May 12, 2021
@ahoppen ahoppen deleted the pr-5.5/check-null-getresulttype branch May 17, 2021 17:11
@AnthonyLatsis AnthonyLatsis added swift 5.5 🍒 release cherry pick Flag: Release branch cherry picks labels Jan 8, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🍒 release cherry pick Flag: Release branch cherry picks swift 5.5
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants