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.
This commit is contained in:
Alex Crichton
2021-11-22 12:21:26 -06:00
committed by GitHub
parent 9ecff69f47
commit ec43254292

View File

@@ -265,6 +265,12 @@ pub fn differential_execution(
// to accept modules that would otherwise be broken by module linking. // to accept modules that would otherwise be broken by module linking.
config.wasm_module_linking(false); 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 engine = Engine::new(&config).unwrap();
let mut store = create_store(&engine); let mut store = create_store(&engine);
if fuzz_config.consume_fuel { if fuzz_config.consume_fuel {