Skip to content

[5.3][CSGen] Add a null check to prevent using invalid superclass type #33084

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
Jul 24, 2020

Conversation

xedin
Copy link
Contributor

@xedin xedin commented Jul 23, 2020

Cherry-pick of #33083


  • Explanation:

While generating constraints for SuperRefExpr generator has to figure out
a type of superclass associated with a current reference. Doing so might
produce an empty type (aka Type()) when resolution fails, so getSuperType
needs to check whether type is valid before attempting to wrap it into MetatypeType.

  • Scope: Limited to expressions which reference invalid superclass type

  • Resolves: rdar://problem/50819554

  • Risk: Very Low

  • Testing: Added regression tests

  • Reviewer: @hborla

Resolves: rdar://problem/50819554
(cherry picked from commit 8f73ff4)

While generating constraints for `SuperRefExpr` generator has to figure out
a type of superclass associated with a current reference. Doing so might
produce an empty type (aka `Type()`) when resolution fails, so `getSuperType`
needs to check whether type is valid before attempting to wrap it into `MetatypeType`.

Resolves: rdar://problem/50819554
(cherry picked from commit 8f73ff4)
@xedin xedin added the r5.3 label Jul 23, 2020
@xedin xedin requested a review from a team as a code owner July 23, 2020 22:26
@xedin
Copy link
Contributor Author

xedin commented Jul 23, 2020

@swift-ci please test

@swift-ci
Copy link
Contributor

Build failed
Swift Test Linux Platform
Git Sha - 8343c7f

@xedin
Copy link
Contributor Author

xedin commented Jul 23, 2020

@swift-ci please test Linux platform

@xedin xedin merged commit b1afaca into swiftlang:release/5.3 Jul 24, 2020
@AnthonyLatsis AnthonyLatsis added swift 5.3 🍒 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.3
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants