From cdf158cd5043ca85a002bda137d39bf1c7dafe38 Mon Sep 17 00:00:00 2001 From: Alex Crichton Date: Fri, 9 Oct 2020 10:09:27 -0700 Subject: [PATCH] Fix enabling interrupts in fuzzers Modifying the `Config` after the gneine has been created has no effect, so be sure to flag the configuration as interruptible earlier. --- crates/fuzzing/src/oracles.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crates/fuzzing/src/oracles.rs b/crates/fuzzing/src/oracles.rs index 7b321f0a47..d0e7fc3e88 100644 --- a/crates/fuzzing/src/oracles.rs +++ b/crates/fuzzing/src/oracles.rs @@ -66,11 +66,11 @@ pub fn instantiate(wasm: &[u8], strategy: Strategy) { pub fn instantiate_with_config(wasm: &[u8], mut config: Config, timeout: Option) { crate::init_fuzzing(); + config.interruptable(timeout.is_some()); let engine = Engine::new(&config); let store = Store::new(&engine); if let Some(timeout) = timeout { - config.interruptable(true); let handle = store.interrupt_handle().unwrap(); std::thread::spawn(move || { std::thread::sleep(timeout);