aboutsummaryrefslogtreecommitdiff
path: root/src/parseTools.js
diff options
context:
space:
mode:
Diffstat (limited to 'src/parseTools.js')
-rw-r--r--src/parseTools.js7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/parseTools.js b/src/parseTools.js
index 80320826..9089a9e6 100644
--- a/src/parseTools.js
+++ b/src/parseTools.js
@@ -2695,3 +2695,10 @@ function ensureValidFFIType(type) {
return type === 'float' ? 'double' : type; // ffi does not tolerate float XXX
}
+// FFI return values must arrive as doubles, and we can force them to floats afterwards
+function asmFFICoercion(value, type) {
+ value = asmCoercion(value, ensureValidFFIType(type));
+ if (FROUND && type === 'float') value = asmCoercion(value, 'float');
+ return value;
+}
+