Skip to content

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

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

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

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
@xedin xedin requested a review from hborla July 23, 2020 22:22
@xedin
Copy link
Contributor Author

xedin commented Jul 23, 2020

@swift-ci please smoke test

@xedin xedin merged commit 182683a into swiftlang:master Jul 24, 2020
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