xref: /wasmtime-44.0.1/fuzz/fuzz_targets/component_api.rs (revision cccc4e64)
  • Home
  • History
  • Annotate
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 #![no_main]
2 #![expect(clippy::allow_attributes_without_reason, reason = "crate not migrated")]
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 #[allow(unused_imports)]
10 fn target(input: &mut arbitrary::Unstructured) -> arbitrary::Result<()> {
11     if input.arbitrary()? {
12         static_component_api_target(input)
13     } else {
14         oracles::dynamic_component_api_target(input)
15     }
16 }
17 
18 fuzz_target!(|bytes: &[u8]| {
19     match target(&mut arbitrary::Unstructured::new(bytes)) {
20         Ok(()) | Err(arbitrary::Error::NotEnoughData) => (),
21         Err(error) => panic!("{}", error),
22     }
23 });
24 

served by {OpenGrok

Last Index Update: Fri May 15 20:09:11 GMT 2026