mirror of https://github.com/boa-dev/boa.git
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
22 lines
535 B
22 lines
535 B
#![no_main] |
|
|
|
mod common; |
|
|
|
use crate::common::FuzzSource; |
|
use boa_engine::{Context, JsResult, JsValue}; |
|
use boa_parser::Source; |
|
use libfuzzer_sys::fuzz_target; |
|
use std::io::Cursor; |
|
|
|
fn do_fuzz(original: FuzzSource) -> JsResult<JsValue> { |
|
let mut ctx = Context::builder() |
|
.interner(original.interner) |
|
.instructions_remaining(1 << 16) |
|
.build() |
|
.unwrap(); |
|
ctx.eval(Source::from_reader(Cursor::new(&original.source), None)) |
|
} |
|
|
|
fuzz_target!(|original: FuzzSource| { |
|
let _ = do_fuzz(original); |
|
});
|
|
|