Rust · 346 bytes Raw Blame History
1 #![no_main]
2
3 use libfuzzer_sys::fuzz_target;
4 use armfortas::lexer::{self, SourceForm};
5
6 fuzz_target!(|data: &[u8]| {
7 // Feed arbitrary bytes to the lexer. It must never panic —
8 // errors are fine, panics are bugs.
9 if let Ok(src) = std::str::from_utf8(data) {
10 let _ = lexer::tokenize(src, 0, SourceForm::FreeForm);
11 }
12 });
13