Skip to content

Commit be08fa0

Browse files
committed
Allow having the type of input argument explicit
1 parent b3d4eee commit be08fa0

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ and change the `src/main.rs` to fuzz your code:
3636
extern crate fuzzer_sys;
3737
extern crate your_crate;
3838

39-
fuzz_target!(|data| {
39+
fuzz_target!(|data: &[u8]| {
4040
// code to fuzz goes here
4141
});
4242
```

src/lib.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,5 +22,11 @@ macro_rules! fuzz_target {
2222
pub extern fn rust_fuzzer_test_input($bytes: &[u8]) {
2323
$body
2424
}
25+
};
26+
(|$bytes:ident: &[u8]| $body:block) => {
27+
#[no_mangle]
28+
pub extern fn rust_fuzzer_test_input($bytes: &[u8]) {
29+
$body
30+
}
2531
}
2632
}

0 commit comments

Comments
 (0)