Skip to content

[5.7][TypeChecker] Don’t crash if a ExplicitCastExpr doesn’t have a cast type #59766

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
Jun 29, 2022

Conversation

ahoppen
Copy link
Member

@ahoppen ahoppen commented Jun 28, 2022

  • Explanation: If the type of an ExplicitCastExpr is not valid, it is a null type, which causes a crash when checking if the cast type has parameterized existentials. This PR contains a minimal fix for the crash by checking for nullptr first.
  • Scope: Type checking of is checks with invalid types in result builders
  • Risk: Very low, any code that is affected by this changed behavior previously crashed the compiler
  • Testing: Added regression test case
  • Issue: rdar://95629905
  • Reviewer: @xedin on [TypeChecker] Don’t crash if a ExplicitCastExpr doesn’t have a cast type #59664

… type

If the type of an `ExplicitCastExpr` is not valid, it is a null type, which causes a crash when checking if the cast type has parameterized existentials.

rdar://95629905
@ahoppen ahoppen added the r5.7 label Jun 28, 2022
@ahoppen ahoppen requested a review from a team as a code owner June 28, 2022 22:18
@ahoppen
Copy link
Member Author

ahoppen commented Jun 28, 2022

@swift-ci Please test

@ahoppen ahoppen merged commit 1577eea into swiftlang:release/5.7 Jun 29, 2022
@ahoppen ahoppen deleted the pr-5.7/cast-with-no-type branch June 29, 2022 07:31
@AnthonyLatsis AnthonyLatsis added 🍒 release cherry pick Flag: Release branch cherry picks swift 5.7 labels Jan 9, 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.7
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants