Skip to content

[Reflection] Make TypeRefVisitor robust to NULL typerefs and unknown kinds. #62483

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
Dec 12, 2022

Conversation

mikeash
Copy link
Contributor

@mikeash mikeash commented Dec 9, 2022

These shouldn't happen, but we may encounter bad data which results in a NULL typeref pointer, or a bogus kind value.

rdar://103111816 rdar://103105744

…kinds.

These shouldn't happen, but we may encounter bad data which results in a NULL typeref pointer, or a bogus kind value.

rdar://103111816 rdar://103105744
@mikeash mikeash requested a review from al45tair December 9, 2022 17:45
@mikeash
Copy link
Contributor Author

mikeash commented Dec 9, 2022

@swift-ci please test

Copy link
Contributor

@al45tair al45tair left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we want to log a message when these conditions occur?

@mikeash
Copy link
Contributor Author

mikeash commented Dec 12, 2022

Discussed offline, but repeating here for posterity: this is a somewhat-expected condition (because we'll inevitably encounter bad data in the target process) so we don't want to clutter up the program's output with non-fatal error messages. Ideally we'd return an error to the caller, but that's a much more extensive change to consider later.

@mikeash mikeash merged commit 7bcf1fc into swiftlang:main Dec 12, 2022
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