Browse Source

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.
Ignacio Roldán Etcheverry 4 years ago
parent
commit
27a66ee528
1 changed files with 1 additions and 1 deletions
  1. 1 1
      modules/mono/mono_gd/gd_mono_wasm_m2n.h

+ 1 - 1
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') {
 	} else if constexpr (cookie == 'F') {
 		return *reinterpret_cast<float *>(&p_margs->fargs[fidx(p_idx)]);
 		return *reinterpret_cast<float *>(&p_margs->fargs[fidx(p_idx)]);
 	} else if constexpr (cookie == 'D') {
 	} else if constexpr (cookie == 'D') {
-		return (T)(size_t)p_margs->fargs[p_idx];
+		return (T)p_margs->fargs[p_idx];
 	}
 	}
 }
 }