-
Notifications
You must be signed in to change notification settings - Fork 264
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
move some unsafe code inside an unsafe{} boundary #483
move some unsafe code inside an unsafe{} boundary #483
Conversation
Not sure if this is as tight as you were hoping for @Kixunil |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
FWIW looks ok to me.
ACK 1242e71
Interesting. I saw that clippy failure but ignored it since it had nothing to do with my code ... I guess it's a change in clippy and we need to fix it for CI to pass. |
I don't think it was a change in clippy because we use |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ACK 29ce1cc
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ACK 29ce1cc
But maybe you want commits in the opposite order?
let noncedata_ptr = match noncedata { | ||
Some(arr) => arr.as_c_ptr() as *const _, | ||
None => ptr::null(), | ||
}; |
This comment was marked as resolved.
This comment was marked as resolved.
Sorry, something went wrong.
Now I'm confused, I did a clippy PR #484 that includes additional fixes to this PR but this is green? And how is it green if the clippy fixes are done as second patch? |
CI only runs on the top commit -- and the top commit of this PR has the clippy fixes. |
An internal function had a non-unsafe signature but could be called with data that would cause it to exhibit UB. Move the unsafety inside of the function so that the function signature now enforces soundness. Fixes rust-bitcoin#481
29ce1cc
to
0f29348
Compare
Merged #484 and rebased. Now there are no clippy fixes in this PR. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Merged -- the one remaining commit was identical to the one ACKed by Sanket and Kixunil, and while elichai did not specify a commit, there is really only one that was ever in this PR. |
Oh I'm a goose. |
An internal function had a non-unsafe signature but could be called
with data that would cause it to exhibit UB. Move the unsafety inside
of the function so that the function signature now enforces soundness.
Fixes #481