/src/wasmtime/fuzz/fuzz_targets/component_api.rs
Line | Count | Source |
1 | | #![no_main] |
2 | | #![allow(dead_code, reason = "fuzz-generation sometimes generates unused types")] |
3 | | |
4 | | use libfuzzer_sys::{arbitrary, fuzz_target}; |
5 | | use wasmtime_fuzzing::oracles; |
6 | | |
7 | | include!(concat!(env!("OUT_DIR"), "/static_component_api.rs")); |
8 | | |
9 | 4.68k | fn target(input: &mut arbitrary::Unstructured) -> arbitrary::Result<()> { |
10 | 4.68k | if input.arbitrary()? { |
11 | 1.39k | static_component_api_target(input) |
12 | | } else { |
13 | 3.28k | oracles::component_api::dynamic_component_api_target(input) |
14 | | } |
15 | 4.68k | } |
16 | | |
17 | | fuzz_target!(|bytes: &[u8]| { |
18 | | let _ = target(&mut arbitrary::Unstructured::new(bytes)); |
19 | | }); |