Merge pull request #2616 from alexcrichton/fix-module-linking-fuzzing

Disable module-linking in plain instantiate fuzzers
This commit is contained in:
Nick Fitzgerald
2021-01-28 10:17:04 -08:00
committed by GitHub

View File

@@ -47,12 +47,11 @@ fn log_wasm(wasm: &[u8]) {
/// ///
/// You can control which compiler is used via passing a `Strategy`. /// You can control which compiler is used via passing a `Strategy`.
pub fn instantiate(wasm: &[u8], known_valid: bool, strategy: Strategy) { pub fn instantiate(wasm: &[u8], known_valid: bool, strategy: Strategy) {
instantiate_with_config( // Explicitly disable module linking for now since it's a breaking change to
wasm, // pre-module-linking modules due to imports
known_valid, let mut cfg = crate::fuzz_default_config(strategy).unwrap();
crate::fuzz_default_config(strategy).unwrap(), cfg.wasm_module_linking(false);
None, instantiate_with_config(wasm, known_valid, cfg, None);
);
} }
/// Instantiate the Wasm buffer, and implicitly fail if we have an unexpected /// Instantiate the Wasm buffer, and implicitly fail if we have an unexpected