-
Notifications
You must be signed in to change notification settings - Fork 47
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
Add multiple variables implementing the Arbitrary
type to fuzz_target!
#77
Comments
As a short term fix you can wrap both variables in a tuple |
Relevant: rust-fuzz/cargo-fuzz#252 |
fuzz_target!(|(rgb, other): (Rgb, Other)| {}) Unexpectely the above syntax also doesn't work. I used this to work around the issue: fuzz_target!(|data: (Rgb, Other)| {
let (rbg, other) = data;
}) |
For those who want to know the reason, this is because every branch of the macro takes macro_rules! fuzz_target {
(|$bytes:ident| $body:expr) => { ... };
(|$data:ident: &[u8]| $body:expr) => { ... };
(|$data:ident: $dty:ty| $body:expr) => { ... };
(|$data:ident: $dty:ty| -> $rty:ty $body:block) => { ... };
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
A possible upgrade would be the ability for creating multiple variables that are to be fuzzed from the same data in the
fuzz_target
macro.Something like this?
That, or have another macro named
fuzz_targets
The text was updated successfully, but these errors were encountered: