From ec43254292122f5bf6b4f366d8ffb91349258dfd Mon Sep 17 00:00:00 2001 From: Alex Crichton Date: Mon, 22 Nov 2021 12:21:26 -0600 Subject: [PATCH] Enable nan canonicalization in differential fuzzing (#3557) This fixes a fuzz issue discovered over the weekend where stores with different values for nan canonicalization may produce different results. This is expected, however, so the fix for differential execution is to always enable nan canonicalization. --- crates/fuzzing/src/oracles.rs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/crates/fuzzing/src/oracles.rs b/crates/fuzzing/src/oracles.rs index 8d2fd334c7..d3b440e559 100644 --- a/crates/fuzzing/src/oracles.rs +++ b/crates/fuzzing/src/oracles.rs @@ -265,6 +265,12 @@ pub fn differential_execution( // to accept modules that would otherwise be broken by module linking. config.wasm_module_linking(false); + // We don't want different configurations with different values for nan + // canonicalization since that can affect results. All configs should + // have the same value configured for this option, so `true` is + // arbitrarily chosen here. + config.cranelift_nan_canonicalization(true); + let engine = Engine::new(&config).unwrap(); let mut store = create_store(&engine); if fuzz_config.consume_fuel {