diff --git a/wasmtime-runtime/src/jit_int.rs b/wasmtime-runtime/src/jit_int.rs index 24c6bc8fdb..22b70d39d4 100644 --- a/wasmtime-runtime/src/jit_int.rs +++ b/wasmtime-runtime/src/jit_int.rs @@ -36,7 +36,13 @@ static mut __jit_debug_descriptor: JITDescriptor = JITDescriptor { #[no_mangle] #[inline(never)] -extern "C" fn __jit_debug_register_code() {} +extern "C" fn __jit_debug_register_code() { + // Hack to not allow inlining even when Rust wants to do it in release mode. + let x = 3; + unsafe { + std::ptr::read_volatile(&x); + } +} /// Registeration for JIT image pub struct GdbJitImageRegistration {