Skip to content

Commit 1ec5a22

Browse files
authored
fuzz: Update wasmi to v0.51.1 (#11946)
* fuzz: Update `wasmi` to v0.51.1 We had to disable some of Wasm proposals in wasmi due to bugs caught by the fuzzer, however these bugs were fixed a while ago; everything is working as expected on v0.51.1 * Use non-deprecated APIs instead And fix value representation for `FuncRef` / `ExternRef`
1 parent 92126c5 commit 1ec5a22

3 files changed

Lines changed: 15 additions & 47 deletions

File tree

Cargo.lock

Lines changed: 11 additions & 33 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

crates/fuzzing/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ wasm-encoder = { workspace = true }
3232
wasm-smith = { workspace = true, features = ['serde'] }
3333
wasm-mutate = { workspace = true }
3434
wasm-spec-interpreter = { path = "./wasm-spec-interpreter", optional = true }
35-
wasmi = { version = "0.43.1", default-features = false, features = ["std", "simd"] }
35+
wasmi = { version = "0.51.1", default-features = false, features = ["std", "simd"] }
3636
futures = { workspace = true }
3737
wasmtime-test-util = { workspace = true, features = ['wast', 'component-fuzz', 'component'] }
3838
serde_json = { workspace = true }

crates/fuzzing/src/oracles/diff_wasmi.rs

Lines changed: 3 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -19,15 +19,6 @@ impl WasmiEngine {
1919
config.exceptions_enabled = false;
2020
config.gc_enabled = false;
2121

22-
// FIXME: once the active fuzz bug for wasmi's simd differential fuzzing
23-
// has been fixed and we've updated then this should be re-enabled.
24-
config.simd_enabled = false;
25-
// FIXME: requires updating to a wasmi that contains
26-
// wasmi-labs/wasmi#1531.
27-
config.memory64_enabled = false;
28-
// FIXME: until https://github.com/wasmi-labs/wasmi/issues/1544 is fixed.
29-
config.wide_arithmetic_enabled = false;
30-
3122
let mut wasmi_config = wasmi::Config::default();
3223
wasmi_config
3324
.consume_fuel(false)
@@ -81,8 +72,7 @@ impl DiffEngine for WasmiEngine {
8172
wasmi::Module::new(&self.engine, wasm).context("unable to validate Wasm module")?;
8273
let mut store = wasmi::Store::new(&self.engine, ());
8374
let instance = wasmi::Linker::<()>::new(&self.engine)
84-
.instantiate(&mut store, &module)
85-
.and_then(|i| i.start(&mut store))
75+
.instantiate_and_start(&mut store, &module)
8676
.context("unable to instantiate module in wasmi")?;
8777
Ok(Box::new(WasmiInstance { store, instance }))
8878
}
@@ -187,11 +177,11 @@ impl From<&DiffValue> for wasmi::Val {
187177
DiffValue::V128(n) => WasmiValue::V128(wasmi::core::V128::from(n)),
188178
DiffValue::FuncRef { null } => {
189179
assert!(null);
190-
WasmiValue::FuncRef(wasmi::FuncRef::null())
180+
WasmiValue::default(wasmi::ValType::FuncRef)
191181
}
192182
DiffValue::ExternRef { null } => {
193183
assert!(null);
194-
WasmiValue::ExternRef(wasmi::ExternRef::null())
184+
WasmiValue::default(wasmi::ValType::ExternRef)
195185
}
196186
DiffValue::AnyRef { .. } => unimplemented!(),
197187
DiffValue::ExnRef { .. } => unimplemented!(),

0 commit comments

Comments
 (0)