We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Repro that ends up executing SIGILL due to undefined behavior:
use borsh::BorshDeserialize; use std::io::Result; struct B(u8, Void); enum Void {} impl BorshDeserialize for B { fn deserialize(_buf: &mut &[u8]) -> Result<Self> { unreachable!() } fn is_u8() -> bool { true } } fn main() { let x = Vec::<B>::deserialize(&mut &[1, 0, 0, 0, 0][..]).unwrap(); match x[0].1 {} }
$ cargo run --release Illegal instruction (core dumped)
The text was updated successfully, but these errors were encountered:
@evgenykuzyakov It seems that we should mark is_u8 as unsafe and make sure we have the documentation on why it is so.
is_u8
unsafe
@dtolnay Do you think there is a better approach?
Sorry, something went wrong.
evgenykuzyakov
Successfully merging a pull request may close this issue.
Repro that ends up executing SIGILL due to undefined behavior:
The text was updated successfully, but these errors were encountered: