From 513c666d352c1bbff44c58b27edd46dcea54a73e Mon Sep 17 00:00:00 2001 From: iximeow Date: Sun, 13 Apr 2025 19:40:49 -0700 Subject: actually commit the fuzz target and a bit of test binary --- fuzz/fuzz_targets/no-panic.rs | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 fuzz/fuzz_targets/no-panic.rs (limited to 'fuzz/fuzz_targets/no-panic.rs') diff --git a/fuzz/fuzz_targets/no-panic.rs b/fuzz/fuzz_targets/no-panic.rs new file mode 100644 index 0000000..d2653dd --- /dev/null +++ b/fuzz/fuzz_targets/no-panic.rs @@ -0,0 +1,18 @@ +#![no_main] +use libfuzzer_sys::fuzz_target; + +use yaxpeax_arch::Decoder; + +use std::fmt::Write; + +fuzz_target!(|data: &[u8]| { + let decoder = yaxpeax_hexagon::InstDecoder::default(); + + let mut hexagon_inst = yaxpeax_hexagon::InstructionPacket::default(); + + let mut words = yaxpeax_arch::U8Reader::new(data); + + // whatever the output, we should be able to format the instruction that was decoded into + let _ = decoder.decode_into(&mut hexagon_inst, &mut words); + write!(&mut String::new(), "{}", hexagon_inst).expect("formatting does not panic either"); +}); -- cgit v1.1