Skip to content

Fix the swift-inspect dump-generic-metadata operation. #66524

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
Jun 14, 2023

Conversation

hjyamauchi
Copy link
Contributor

ReflectionContext::allocationMetadataPointer() was reading the metadata pointer from a wrong offset because of the out-of-sync struct layouts and dump-generic-metadata was not working correctly.

This change resync's the layouts and adds a static_assert to verify that the offsets match between GenericMetadataCacheEntry and GenericCacheEntry.

ReflectionContext::allocationMetadataPointer() was reading the
metadata pointer from a wrong offset because of the out-of-sync struct
layouts and dump-generic-metadata was not working correctly.

This change resync's the layouts and adds a static_assert to verify
that the offsets match between GenericMetadataCacheEntry and
GenericCacheEntry.
@hjyamauchi
Copy link
Contributor Author

@compnerd

@compnerd
Copy link
Member

CC: @al45tair @mikeash

Copy link
Contributor

@mikeash mikeash left a comment

Choose a reason for hiding this comment

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

LGTM. I don't have any particular opinion one way or the other about where the static_assert should go, this approach seems OK.

@compnerd
Copy link
Member

@swift-ci please test

Copy link
Member

@compnerd compnerd left a comment

Choose a reason for hiding this comment

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

Thanks for fixing this!

@compnerd compnerd merged commit df71ee0 into swiftlang:main Jun 14, 2023
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.

3 participants