/src/regex/fuzz/fuzz_targets/ast_fuzz_regex.rs
Line | Count | Source (jump to first uncovered line) |
1 | | #![no_main] |
2 | | |
3 | | use { |
4 | | libfuzzer_sys::fuzz_target, regex::RegexBuilder, regex_syntax::ast::Ast, |
5 | | }; |
6 | | |
7 | 49.3k | #[derive(Eq, PartialEq, arbitrary::Arbitrary)] <ast_fuzz_regex::FuzzData as arbitrary::Arbitrary>::arbitrary_take_rest::{closure#1} Line | Count | Source | 7 | 16.5k | #[derive(Eq, PartialEq, arbitrary::Arbitrary)] |
<ast_fuzz_regex::FuzzData as arbitrary::Arbitrary>::try_size_hint::{closure#0} Line | Count | Source | 7 | 32.8k | #[derive(Eq, PartialEq, arbitrary::Arbitrary)] |
Unexecuted instantiation: <ast_fuzz_regex::FuzzData as arbitrary::Arbitrary>::arbitrary::{closure#0} Unexecuted instantiation: <ast_fuzz_regex::FuzzData as arbitrary::Arbitrary>::arbitrary::{closure#1} Unexecuted instantiation: <ast_fuzz_regex::FuzzData as arbitrary::Arbitrary>::arbitrary::{closure#2} Unexecuted instantiation: <ast_fuzz_regex::FuzzData as arbitrary::Arbitrary>::arbitrary_take_rest::{closure#0} Unexecuted instantiation: <ast_fuzz_regex::FuzzData as arbitrary::Arbitrary>::arbitrary_take_rest::{closure#2} |
8 | | struct FuzzData { |
9 | | ast: Ast, |
10 | | } |
11 | | |
12 | | impl std::fmt::Debug for FuzzData { |
13 | 0 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { |
14 | 0 | let mut builder = f.debug_struct("FuzzData"); |
15 | 0 | builder.field("ast", &format!("{}", self.ast)); |
16 | 0 | builder.finish() |
17 | 0 | } |
18 | | } |
19 | | |
20 | | fuzz_target!(|data: FuzzData| { |
21 | | let _ = env_logger::try_init(); |
22 | | |
23 | | let pattern = format!("{}", data.ast); |
24 | | RegexBuilder::new(&pattern).size_limit(1 << 20).build().ok(); |
25 | | }); |