Skip to content

[Runtime] memset ExtraData fully before copy from pattern. #28478

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 4, 2019
Merged

[Runtime] memset ExtraData fully before copy from pattern. #28478

merged 1 commit into from
Dec 4, 2019

Conversation

varungandhi-apple
Copy link
Contributor

The third argument of memset needs a size in bytes, not words.

@varungandhi-apple
Copy link
Contributor Author

@swift-ci please test

@varungandhi-apple varungandhi-apple changed the title [Runtime] Memset Extradata fully before copy from pattern. [Runtime] memset ExtraData fully before copy from pattern. Nov 26, 2019
Copy link
Contributor

@rjmccall rjmccall left a comment

Choose a reason for hiding this comment

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

Substantively approved, but because this may affect future uses, please add a comment in the following two places saying that versions of the runtime prior to Swift 5.2 are known to not properly zero the zero prefix of the extra-data pattern:

  • in Metadata.h on getExtraDataPattern()
  • in GenMeta.cpp in GenericMetadataBuilderBase::layout() where it adds the extra-data pattern

Testing this is possible but probably excessively annoying.

The third argument of memset needs a size in *bytes* not words.
@varungandhi-apple
Copy link
Contributor Author

Added a comment explaining this and linked to it from the places you mentioned.

@swift-ci please test

@swift-ci

This comment has been minimized.

@swift-ci

This comment has been minimized.

Copy link
Contributor

@rjmccall rjmccall left a comment

Choose a reason for hiding this comment

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

LGTM

@varungandhi-apple
Copy link
Contributor Author

Test failure is due to another issue. Fix is in #28542.

@varungandhi-apple
Copy link
Contributor Author

@swift-ci please test macOS platform

@varungandhi-apple varungandhi-apple merged commit affa1b4 into swiftlang:master Dec 4, 2019
@varungandhi-apple varungandhi-apple deleted the vg-memset-extradata-thoroughly branch December 4, 2019 16:48
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