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

Heads-up: UB due to misuse of mem::uninitialized will soon lead to panic #11

Open
RalfJung opened this issue Feb 16, 2020 · 0 comments
Open

Comments

@RalfJung
Copy link

Here, this crate causes UB by "Producing an invalid value". Concretely, it produces a value of type VAlign with mem::uninitialized(), but enums must always be in one of their variants. In the near future the call to mem::uninitialized() will panic to avoid UB, and our crater run determined that this crate will be affected.

mem::uninitialized() is deprecated since Rust 1.39. The intended replacement is MaybeUninit, which tracks the possibility of uninitialized values at the type level to make sure the compiler does not make any false assumptions.

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

No branches or pull requests

1 participant