fix fuzzing

it leaks????
This commit is contained in:
nora 2021-12-30 18:23:21 +01:00
parent 9eff0f0188
commit 145d63e755
12 changed files with 35 additions and 284 deletions

View file

@ -2,6 +2,6 @@
use libfuzzer_sys::fuzz_target;
fuzz_target!(|data: String| {
let lexer = script_lang::Lexer::lex(&data);
let _tokens = lexer.collect::<Vec<_>>();
let lexer = dilaria::Lexer::new(&data);
for _ in lexer {}
});

View file

@ -2,10 +2,9 @@
use libfuzzer_sys::fuzz_target;
fuzz_target!(|data: String| {
let lexer = script_lang::Lexer::lex(&data);
let tokens = lexer.collect::<Result<Vec<_>, _>>();
let ast_alloc = dilaria::Bump::new();
if let Ok(tokens) = tokens {
let _ast = script_lang::parse(tokens);
}
let lexer = dilaria::Lexer::new(&data);
let _ast = dilaria::parse(lexer, &ast_alloc);
});