Skip to content

Properly handle nulls in runtime upcast checks #2042

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 2 commits into from
Sep 4, 2021
Merged

Properly handle nulls in runtime upcast checks #2042

merged 2 commits into from
Sep 4, 2021

Conversation

dcodeIO
Copy link
Member

@dcodeIO dcodeIO commented Aug 20, 2021

Fixes #2035 by bypassing null values in emitted runtime upcast checks (which __instanceof naturally cannot handle) while keeping the current behavior as a simplification where the value can be statically determined to be non-null.

  • I've read the contributing guidelines
  • I've added my name and email to the NOTICE file

@dcodeIO
Copy link
Member Author

dcodeIO commented Aug 20, 2021

cc @trusktr Can you confirm that this fixes the issue you are seeing?

@trusktr
Copy link
Member

trusktr commented Sep 3, 2021

I need to try this. I have TODO comments in place.

@dcodeIO dcodeIO merged commit df3d29c into main Sep 4, 2021
@dcodeIO dcodeIO deleted the issue-2035 branch September 5, 2021 10:57
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.

Upcast check is missing a null check when casting to a nullable type
2 participants