Index: src/wasm/wasm-external-refs.cc |
diff --git a/src/wasm/wasm-external-refs.cc b/src/wasm/wasm-external-refs.cc |
index 52a96959b16cdb4c16cfc77aa4ba9a310161c0eb..09294c2c288ffeff6c436ccd4c39677d54ab8d8a 100644 |
--- a/src/wasm/wasm-external-refs.cc |
+++ b/src/wasm/wasm-external-refs.cc |
@@ -25,13 +25,21 @@ void f32_ceil_wrapper(float* param) { *param = ceilf(*param); } |
void f32_nearest_int_wrapper(float* param) { *param = nearbyintf(*param); } |
-void f64_trunc_wrapper(double* param) { *param = trunc(*param); } |
+void f64_trunc_wrapper(double* param) { |
+ WriteDoubleValue(param, trunc(ReadDoubleValue(param))); |
+} |
-void f64_floor_wrapper(double* param) { *param = floor(*param); } |
+void f64_floor_wrapper(double* param) { |
+ WriteDoubleValue(param, floor(ReadDoubleValue(param))); |
+} |
-void f64_ceil_wrapper(double* param) { *param = ceil(*param); } |
+void f64_ceil_wrapper(double* param) { |
+ WriteDoubleValue(param, ceil(ReadDoubleValue(param))); |
+} |
-void f64_nearest_int_wrapper(double* param) { *param = nearbyint(*param); } |
+void f64_nearest_int_wrapper(double* param) { |
+ WriteDoubleValue(param, nearbyint(ReadDoubleValue(param))); |
+} |
void int64_to_float32_wrapper(int64_t* input, float* output) { |
*output = static_cast<float>(*input); |