Skip to content

[Reflection] Ignore BuiltinTypeDescriptors with zero size, alignment, or stride. #28183

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

Conversation

mikeash
Copy link
Contributor

@mikeash mikeash commented Nov 11, 2019

rdar://problem/56784375

@mikeash mikeash requested a review from jckarter November 11, 2019 16:29
@jckarter
Copy link
Contributor

What happens if we remove the check for Size > 0 altogether? A Swift type could legitimately have zero size.

@jckarter
Copy link
Contributor

It'd also be good to strengthen the check on Alignment to make sure that it's a power of two (or a power of two minus one, I forget what representation we use here), more than just being greater than zero.

@slavapestov
Copy link
Contributor

Can you add a test case?

@mikeash mikeash force-pushed the zero-size-builtin-type-descriptors-remote-mirror branch from a3b632a to e716300 Compare November 14, 2019 21:56
@mikeash
Copy link
Contributor Author

mikeash commented Nov 14, 2019

I added a test and remove the size check. I will also fix up the alignment check as suggested.

Copy link
Contributor

@jckarter jckarter left a comment

Choose a reason for hiding this comment

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

Looks good, thanks!

@mikeash
Copy link
Contributor Author

mikeash commented Nov 15, 2019

@swift-ci please test

@swift-ci
Copy link
Contributor

Build failed
Swift Test Linux Platform
Git Sha - e716300

@swift-ci
Copy link
Contributor

Build failed
Swift Test OS X Platform
Git Sha - e716300

@mikeash mikeash merged commit 8499a7f into swiftlang:master Nov 15, 2019
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.

4 participants