-
Notifications
You must be signed in to change notification settings - Fork 335
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
Make MemoryImage::new() failable + bound check #533
Conversation
risc0/zkvm/src/binfmt/image.rs
Outdated
} | ||
buf[addr..(WORD_SIZE + addr)].copy_from_slice(&bytes[..WORD_SIZE]); |
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.
buf[addr..(WORD_SIZE + addr)].copy_from_slice(&bytes[..WORD_SIZE]); | |
buf.as_slice().get(addr..(WORD_SIZE + addr))?.copy_from_slice(&bytes[..WORD_SIZE]); |
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.
good call, we could drop the if + bail! then right?
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.
err I guess that would remove the friendly Error string
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.
Combined the two here: d610dc2
Benchmark for Linux-cuda 54bb7eaClick to hide benchmark
Benchmark for Linux-default 54bb7eaClick to hide benchmark
Benchmark for macOS-default 54bb7eaClick to hide benchmark
Benchmark for macOS-metal 54bb7eaClick to hide benchmark
|
Fixes #531