Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix fuzz errors #3443

Merged
merged 2 commits into from
Jan 2, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions fuzz/fuzz_targets/deterministic.rs
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ fuzz_target!(|module: ConfiguredModule<NoImportsConfig>| {
compiler.enable_verifier();
compile_and_compare(
"universal-cranelift",
EngineBuilder::new(compiler.clone()),
EngineBuilder::new(compiler.clone()).engine(),
&wasm_bytes,
);

Expand All @@ -55,14 +55,14 @@ fuzz_target!(|module: ConfiguredModule<NoImportsConfig>| {
compiler.enable_verifier();
compile_and_compare(
"universal-llvm",
EngineBuilder::new(compiler.clone()),
EngineBuilder::new(compiler.clone()).engine(),
&wasm_bytes,
);

let compiler = Singlepass::default();
compile_and_compare(
"universal-singlepass",
EngineBuilder::new(compiler.clone()),
EngineBuilder::new(compiler.clone()).engine(),
&wasm_bytes,
);
});
4 changes: 2 additions & 2 deletions fuzz/fuzz_targets/metering.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ use libfuzzer_sys::{arbitrary, arbitrary::Arbitrary, fuzz_target};
use std::sync::Arc;
use wasm_smith::{Config, ConfiguredModule};
use wasmer::wasmparser::Operator;
use wasmer::{imports, CompilerConfig, EngineBuilder, Instance, Module, Store};
use wasmer::{imports, CompilerConfig, Instance, Module, Store};
use wasmer_compiler_cranelift::Cranelift;
use wasmer_middlewares::Metering;

Expand Down Expand Up @@ -57,7 +57,7 @@ fuzz_target!(|module: WasmSmithModule| {
compiler.push_middleware(metering);
let mut store = Store::new(compiler);
let module = Module::new(&store, &wasm_bytes).unwrap();
match Instance::new(&module, &imports! {}) {
match Instance::new(&mut store, &module, &imports! {}) {
Ok(_) => {}
Err(e) => {
let error_message = format!("{}", e);
Expand Down
4 changes: 2 additions & 2 deletions fuzz/fuzz_targets/universal_llvm.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

use libfuzzer_sys::{arbitrary, arbitrary::Arbitrary, fuzz_target};
use wasm_smith::{Config, ConfiguredModule};
use wasmer::{imports, CompilerConfig, EngineBuilder, Instance, Module, Store};
use wasmer::{imports, CompilerConfig, Instance, Module, Store};
use wasmer_compiler_llvm::LLVM;

#[derive(Arbitrary, Debug, Default, Copy, Clone)]
Expand Down Expand Up @@ -43,7 +43,7 @@ fuzz_target!(|module: WasmSmithModule| {
compiler.enable_verifier();
let mut store = Store::new(compiler);
let module = Module::new(&store, &wasm_bytes).unwrap();
match Instance::new(&module, &imports! {}) {
match Instance::new(&mut store, &module, &imports! {}) {
Ok(_) => {}
Err(e) => {
let error_message = format!("{}", e);
Expand Down
4 changes: 2 additions & 2 deletions fuzz/fuzz_targets/universal_singlepass.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

use libfuzzer_sys::{arbitrary, arbitrary::Arbitrary, fuzz_target};
use wasm_smith::{Config, ConfiguredModule};
use wasmer::{imports, EngineBuilder, Instance, Module, Store};
use wasmer::{imports, Instance, Module, Store};
use wasmer_compiler_singlepass::Singlepass;

#[derive(Arbitrary, Debug, Default, Copy, Clone)]
Expand Down Expand Up @@ -51,7 +51,7 @@ fuzz_target!(|module: WasmSmithModule| {
panic!("{}", e);
}
};
match Instance::new(&module, &imports! {}) {
match Instance::new(&mut store, &module, &imports! {}) {
Ok(_) => {}
Err(e) => {
let error_message = format!("{}", e);
Expand Down