Skip to content

Commit 1d40214

Browse files
authored
fuzz(mutate): enable the custom-page-sizes proposal as necessary (#1619)
* fuzz(mutate): enable the custom-page-sizes proposal as necessary If `wasm-smith` enabled it, then we need to enable it for validation of the mutated binaries. * Enable all validator features * fix unused var
1 parent 2b51f7c commit 1d40214

1 file changed

Lines changed: 2 additions & 14 deletions

File tree

fuzz/src/mutate.rs

Lines changed: 2 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ pub fn run(u: &mut Unstructured<'_>) -> Result<()> {
1111

1212
let mut seed = 0;
1313
let mut preserve_semantics = false;
14-
let (wasm, config) = crate::generate_valid_module(u, |config, u| {
14+
let (wasm, _config) = crate::generate_valid_module(u, |config, u| {
1515
config.exceptions_enabled = false;
1616
config.gc_enabled = false;
1717
seed = u.arbitrary()?;
@@ -55,19 +55,7 @@ pub fn run(u: &mut Unstructured<'_>) -> Result<()> {
5555
}
5656
};
5757

58-
// Note that on-by-default features in wasmparser are not disabled here if
59-
// the feature was disabled in `config` when the module was generated. For
60-
// example if the input module doesn't have simd then wasm-mutate may
61-
// produce a module that uses simd, which is ok and expected.
62-
//
63-
// Otherwise only forward some off-by-default features which are affected by
64-
// wasm-smith's generation of modules and wasm-mutate otherwise won't add
65-
// itself if it doesn't already exist.
66-
let mut features = WasmFeatures::default();
67-
features.set(WasmFeatures::RELAXED_SIMD, config.relaxed_simd_enabled);
68-
features.set(WasmFeatures::MULTI_MEMORY, config.max_memories > 1);
69-
features.set(WasmFeatures::MEMORY64, config.memory64_enabled);
70-
features.set(WasmFeatures::THREADS, config.threads_enabled);
58+
let features = WasmFeatures::all();
7159

7260
for (i, mutated_wasm) in iterator.take(10).enumerate() {
7361
let mutated_wasm = match mutated_wasm {

0 commit comments

Comments
 (0)