Skip to content

A lightweight WebAssembly runtime that is fast, secure, and standards-compliant

Shuffle around adjusting tunables in fuzzing (#13142)

Alex Crichton3a1920b1b1c6
diff --git a/crates/fuzzing/src/generators/config.rs b/crates/fuzzing/src/generators/config.rs
index 3b365e9547..7084f350fd 100644
--- a/crates/fuzzing/src/generators/config.rs
+++ b/crates/fuzzing/src/generators/config.rs
@@ -825,18 +825,6 @@ impl WasmtimeConfig {
/// these sorts of configurations. For now though it's intended to reflect
/// the current state of the engine's development.
pub(crate) fn make_internally_consistent(&mut self) {
- // When using the pooling allocator, GC heap tunables must match memory
- // tunables.
- if let InstanceAllocationStrategy::Pooling(_) = &self.strategy {
- self.memory_config.gc_heap_reservation = self.memory_config.memory_reservation;
- self.memory_config.gc_heap_guard_size = self.memory_config.memory_guard_size;
- self.memory_config.gc_heap_reservation_for_growth =
- self.memory_config.memory_reservation_for_growth;
- // memory_may_move is not in MemoryConfig, but gc_heap_may_move
- // must not conflict. Set it to None so the default matches.
- self.memory_config.gc_heap_may_move = None;
- }
-
if !self.signals_based_traps {
let cfg = &mut self.memory_config;
// Spectre-based heap mitigations require signal handlers so
@@ -870,6 +858,18 @@ impl WasmtimeConfig {
}
}
}
+
+ // When using the pooling allocator, GC heap tunables must match memory
+ // tunables.
+ if let InstanceAllocationStrategy::Pooling(_) = &self.strategy {
+ self.memory_config.gc_heap_reservation = self.memory_config.memory_reservation;
+ self.memory_config.gc_heap_guard_size = self.memory_config.memory_guard_size;
+ self.memory_config.gc_heap_reservation_for_growth =
+ self.memory_config.memory_reservation_for_growth;
+ // memory_may_move is not in MemoryConfig, but gc_heap_may_move
+ // must not conflict. Set it to None so the default matches.
+ self.memory_config.gc_heap_may_move = None;
+ }
}
}