Add fuzzing
Signed-off-by: Marcel Müller <neikos@neikos.email>
This commit is contained in:
parent
e0e84ede1c
commit
fa1582f3ad
6 changed files with 327 additions and 0 deletions
18
fuzz/fuzz_targets/fuzz_target_1.rs
Normal file
18
fuzz/fuzz_targets/fuzz_target_1.rs
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
#![no_main]
|
||||
|
||||
use libfuzzer_sys::Corpus;
|
||||
use libfuzzer_sys::fuzz_target;
|
||||
|
||||
fuzz_target!(|data: String| -> Corpus {
|
||||
let Ok(parsed) = nomo::parser::parse(data.into()) else {
|
||||
return Corpus::Reject;
|
||||
};
|
||||
|
||||
let Ok(ast) = nomo::ast::parse(parsed.tokens()) else {
|
||||
return Corpus::Keep;
|
||||
};
|
||||
|
||||
let _instructions = nomo::emit::emit_machine(ast);
|
||||
|
||||
Corpus::Keep
|
||||
});
|
||||
Loading…
Add table
Add a link
Reference in a new issue