Skip to content

Fix warnings and incorrect size in from raw parts#15

Merged
fitzgen merged 4 commits intomasterfrom
fix-warnings-and-incorrect-size-in-from-raw-parts
Jan 19, 2018
Merged

Fix warnings and incorrect size in from raw parts#15
fitzgen merged 4 commits intomasterfrom
fix-warnings-and-incorrect-size-in-from-raw-parts

Conversation

@fitzgen
Copy link
Copy Markdown
Owner

@fitzgen fitzgen commented Jan 19, 2018

rs? @tromey

`std::process` is only used if debug assertions aren't enabled, so we can either
`#[cfg]` the import or scope it to where it is used. I chose the latter.
`size` is in bytes, but the `Vec` is a `Vec<usize>`. This doesn't blow up in
practice because `usize` doesn't have a destructor, but if it did, then we would
have been running destructors on garbage, out-of-bounds memory!

As reported in https://news.ycombinator.com/item?id=16183438 -- great catch!
Copy link
Copy Markdown
Collaborator

@tromey tromey left a comment

Choose a reason for hiding this comment

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

Thanks. Looks good to me.

@fitzgen
Copy link
Copy Markdown
Owner Author

fitzgen commented Jan 19, 2018

Thanks! I'm going to push a vlq update commit here too, then merge.

@fitzgen fitzgen merged commit 4d2ee85 into master Jan 19, 2018
@fitzgen fitzgen deleted the fix-warnings-and-incorrect-size-in-from-raw-parts branch January 19, 2018 19:36
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.

2 participants