Skip to content

Commit

Permalink
Do fuzzing with the full interpreter activated
Browse files Browse the repository at this point in the history
  • Loading branch information
sharkdp committed Jul 24, 2023
1 parent 2a65603 commit 2c65fa1
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
7 changes: 4 additions & 3 deletions numbat/fuzz/fuzz_targets/parser.rs
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
#![no_main]

use libfuzzer_sys::fuzz_target;
use numbat::parser::parse;
use numbat::{self, CodeSource};

fuzz_target!(|data: &[u8]| {
if let Ok(s) = std::str::from_utf8(data) {
let _ = parse(s, 0);
if let Ok(code) = std::str::from_utf8(data) {
let mut ctx = numbat::Context::new_without_importer();
let _ = ctx.interpret(code, CodeSource::Text);
}
});
2 changes: 1 addition & 1 deletion numbat/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ mod interpreter;
pub mod markup;
mod name_resolution;
mod number;
pub mod parser;
mod parser;
mod prefix;
mod prefix_parser;
mod prefix_transformer;
Expand Down

0 comments on commit 2c65fa1

Please sign in to comment.