diff options
author | Alon Zakai <alonzakai@gmail.com> | 2013-10-29 14:36:15 -0700 |
---|---|---|
committer | Alon Zakai <alonzakai@gmail.com> | 2013-10-29 14:36:15 -0700 |
commit | 2f2f3ca9fbbe5906bb68aa56edf7eca192ac9dc1 (patch) | |
tree | 2377ae19fbc463308c5ca4b460a27458b33c7e7d /src/parseTools.js | |
parent | 76014aec3125274b975196103259018f37785451 (diff) |
use asm ffi coercing for floats in load abort calls
Diffstat (limited to 'src/parseTools.js')
-rw-r--r-- | src/parseTools.js | 7 |
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; +} + |