From 07a6ca8f4e1136ecd9f4af8d1f03a01aade60407 Mon Sep 17 00:00:00 2001 From: Yury Delendik Date: Wed, 10 Apr 2019 10:32:58 -0500 Subject: [PATCH] Hack to not allow inlining even when Rust wants to do it in release mode. --- wasmtime-runtime/src/jit_int.rs | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) 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 {