From 27a66ee5286a82ee1bfa44033f0ce235036a5862 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ignacio=20Rold=C3=A1n=20Etcheverry?= Date: Sat, 17 Apr 2021 05:45:52 +0200 Subject: [PATCH] C#: Fix `double` casting in wasm m2n trampolines The trampolines were casting double to `size_t` (likely a copy-paste mistake), so the value was getting truncated. --- modules/mono/mono_gd/gd_mono_wasm_m2n.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/mono/mono_gd/gd_mono_wasm_m2n.h b/modules/mono/mono_gd/gd_mono_wasm_m2n.h index 159a2ed7b65..366662ff81f 100644 --- a/modules/mono/mono_gd/gd_mono_wasm_m2n.h +++ b/modules/mono/mono_gd/gd_mono_wasm_m2n.h @@ -176,7 +176,7 @@ T m2n_arg_cast(Mono_InterpMethodArguments *p_margs, size_t p_idx) { } else if constexpr (cookie == 'F') { return *reinterpret_cast(&p_margs->fargs[fidx(p_idx)]); } else if constexpr (cookie == 'D') { - return (T)(size_t)p_margs->fargs[p_idx]; + return (T)p_margs->fargs[p_idx]; } }