Skip to content
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

fix minor unsafe pointer type assumption issue #397

Merged
merged 1 commit into from May 9, 2018

Conversation

weissi
Copy link
Member

@weissi weissi commented May 8, 2018

Motivation:

In a test we did assumingMemoryBound(to: in6_addr.self) for something
that was actually bound to UInt8. So we should use
bindMemory(to: in6_addr.self, count: 1) instead

Modifications:

replace one assumingMemoryBound by bindMemory

Result:

more memory correctness is good even for tests

Motivation:

In a test we did `assumingMemoryBound(to: in6_addr.self)` for something
that was actually bound to `UInt8`. So we should use
`bindMemory(to: in6_addr.self, count: 1)` instead

Modifications:

replace one `assumingMemoryBound` by `bindMemory`

Result:

more memory correctness is good even for tests
@weissi weissi requested review from normanmaurer and Lukasa May 8, 2018 22:07
Copy link
Contributor

@Lukasa Lukasa left a comment

Choose a reason for hiding this comment

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

LGTM.

@Lukasa Lukasa merged commit 46f2121 into apple:master May 9, 2018
@normanmaurer
Copy link
Member

late LGTM

@weissi weissi deleted the jw-fix-minor-mem branch May 9, 2018 13:35
@Lukasa Lukasa added the patch-version-bump-only For PRs that when merged will only cause a bump of the patch version, ie. 1.0.x -> 1.0.(x+1) label May 11, 2018
@Lukasa Lukasa added this to the 1.7.0 milestone May 11, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
patch-version-bump-only For PRs that when merged will only cause a bump of the patch version, ie. 1.0.x -> 1.0.(x+1)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants