summaryrefslogtreecommitdiff
path: root/fuzz/fuzz_targets/no-panic.rs
diff options
context:
space:
mode:
authoriximeow <me@iximeow.net>2025-04-13 19:40:49 -0700
committeriximeow <me@iximeow.net>2025-04-13 19:40:49 -0700
commit513c666d352c1bbff44c58b27edd46dcea54a73e (patch)
tree0ae70f543844eaaedcd3c303636dab3f6eee8739 /fuzz/fuzz_targets/no-panic.rs
parent5a1731a2584222cf3e2d66685f96f8dc43cd3542 (diff)
actually commit the fuzz target and a bit of test binary
Diffstat (limited to 'fuzz/fuzz_targets/no-panic.rs')
-rw-r--r--fuzz/fuzz_targets/no-panic.rs18
1 files changed, 18 insertions, 0 deletions
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");
+});