diff options
Diffstat (limited to 'crates/libsyntax2/fuzz/fuzz_targets/parser.rs')
-rw-r--r-- | crates/libsyntax2/fuzz/fuzz_targets/parser.rs | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/crates/libsyntax2/fuzz/fuzz_targets/parser.rs b/crates/libsyntax2/fuzz/fuzz_targets/parser.rs new file mode 100644 index 000000000..f941855e8 --- /dev/null +++ b/crates/libsyntax2/fuzz/fuzz_targets/parser.rs | |||
@@ -0,0 +1,12 @@ | |||
1 | #![no_main] | ||
2 | #[macro_use] extern crate libfuzzer_sys; | ||
3 | extern crate libsyntax2; | ||
4 | |||
5 | fuzz_target!(|data: &[u8]| { | ||
6 | if let Ok(text) = std::str::from_utf8(data) { | ||
7 | let x = libsyntax2::File::parse(text); | ||
8 | let _ = x.ast(); | ||
9 | let _ = x.syntax(); | ||
10 | let _ = x.errors(); | ||
11 | } | ||
12 | }); | ||