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

miri: don't use int2ptr casts for invalid pointers #553

Merged
merged 3 commits into from Jul 9, 2022

Conversation

Darksonn
Copy link
Contributor

@Darksonn Darksonn commented Jul 6, 2022

This fixes a miri failure with strict provenance.

src/bytes_mut.rs Outdated Show resolved Hide resolved
src/bytes_mut.rs Outdated Show resolved Hide resolved
src/bytes_mut.rs Outdated Show resolved Hide resolved
@@ -613,7 +613,7 @@ impl BytesMut {
}

debug_assert_eq!(kind, KIND_ARC);
let shared: *mut Shared = self.data as _;
let shared: *mut Shared = self.data;
Copy link
Member

Choose a reason for hiding this comment

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

nit, take it or leave it: since there isn't a cast here any longer, can't the type annotation be removed?

Suggested change
let shared: *mut Shared = self.data;
let shared = self.data;

@Darksonn Darksonn requested review from hawkw and taiki-e July 9, 2022 11:51
@Darksonn Darksonn merged commit f514bd3 into master Jul 9, 2022
@Darksonn Darksonn deleted the more-strict-provenance branch July 9, 2022 19:54
lelongg pushed a commit to lelongg/bytes that referenced this pull request Jan 9, 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.

None yet

4 participants