#![no_main]
//! The single-function disassembly consumers: `candidate_entries` linear-sweeps the exec sections,
//! then `abi_shape` (backward register liveness) and `make_sig` (wildcard-emitting decode) run from
//! each entry. All decode attacker-controlled code bytes and must never panic — the decoder can hit
//! any instruction, any truncation, any span boundary.
use source2rosetta::elf::CodeImage;
use source2rosetta::{abi, emit, locate};
use libfuzzer_sys::fuzz_target;

fuzz_target!(|data: &[u8]| {
    let Ok(img) = CodeImage::from_bytes(data.to_vec()) else {
        return;
    };
    for &addr in locate::candidate_entries(&img).iter().take(96) {
        // Discard results: this fuzzer only asserts the decoders never panic.
        let _ = abi::abi_shape(&img, addr);
        let _ = emit::make_sig(&img, addr, 128);
    }
});
