Skip to content

Commit dfe5de4

Browse files
authored
Enable cfg(gc_zeal) when fuzzing (#13053)
1 parent 8b684ab commit dfe5de4

3 files changed

Lines changed: 9 additions & 0 deletions

File tree

Cargo.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -214,6 +214,9 @@ check-cfg = [
214214
'cfg(pulley_disable_interp_simd)',
215215
'cfg(arc_try_new)',
216216

217+
# Activated by `cargo fuzz` when building for fuzzing.
218+
'cfg(fuzzing)',
219+
217220
# When enabled, `cfg(gc_zeal)` activates aggressive GC debugging assertions.
218221
'cfg(gc_zeal)',
219222
]

crates/cranelift/build.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
fn main() {
2+
if cfg!(fuzzing) {
3+
println!("cargo:rustc-cfg=gc_zeal");
4+
}
5+
}

crates/wasmtime/build.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ fn main() {
3434
custom_cfg("has_virtual_memory", has_virtual_memory);
3535
custom_cfg("has_custom_sync", has_custom_sync);
3636
custom_cfg("has_host_compiler_backend", has_host_compiler_backend);
37+
custom_cfg("gc_zeal", cfg!(fuzzing));
3738

3839
// If this OS isn't supported and no debug-builtins or if Cranelift doesn't support
3940
// the host or there's no need to build these helpers.

0 commit comments

Comments
 (0)