xref: /wasmtime-44.0.1/fuzz/fuzz_targets/component_api.rs (revision d74b34ff)
  • Home
  • History
  • Annotate
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 #![no_main]
2 
3 use libfuzzer_sys::{arbitrary, fuzz_target};
4 use wasmtime_fuzzing::oracles;
5 
6 include!(concat!(env!("OUT_DIR"), "/static_component_api.rs"));
7 
8 #[allow(unused_imports)]
9 fn target(input: &mut arbitrary::Unstructured) -> arbitrary::Result<()> {
10     if input.arbitrary()? {
11         static_component_api_target(input)
12     } else {
13         oracles::dynamic_component_api_target(input)
14     }
15 }
16 
17 fuzz_target!(|bytes: &[u8]| {
18     match target(&mut arbitrary::Unstructured::new(bytes)) {
19         Ok(()) | Err(arbitrary::Error::NotEnoughData) => (),
20         Err(error) => panic!("{}", error),
21     }
22 });
23 

served by {OpenGrok

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