aboutsummaryrefslogtreecommitdiff
path: root/src/jsifier.js
diff options
context:
space:
mode:
authorAlon Zakai <alonzakai@gmail.com>2013-10-29 14:36:15 -0700
committerAlon Zakai <alonzakai@gmail.com>2013-10-29 14:36:15 -0700
commit2f2f3ca9fbbe5906bb68aa56edf7eca192ac9dc1 (patch)
tree2377ae19fbc463308c5ca4b460a27458b33c7e7d /src/jsifier.js
parent76014aec3125274b975196103259018f37785451 (diff)
use asm ffi coercing for floats in load abort calls
Diffstat (limited to 'src/jsifier.js')
-rw-r--r--src/jsifier.js5
1 files changed, 2 insertions, 3 deletions
diff --git a/src/jsifier.js b/src/jsifier.js
index 329b06c6..669cec73 100644
--- a/src/jsifier.js
+++ b/src/jsifier.js
@@ -1324,7 +1324,7 @@ function JSify(data, functionsOnly, givenFunctions) {
if (isNumber(item.ident)) {
// Direct read from a memory address; this may be an intentional segfault, if not, it is a bug in the source
if (ASM_JS) {
- return asmCoercion('abort(' + item.ident + ')', item.type);
+ return asmFFICoercion('abort(' + item.ident + ')', item.type);
} else {
item.assignTo = null;
return 'throw "fault on read from ' + item.ident + '";';
@@ -1617,8 +1617,7 @@ function JSify(data, functionsOnly, givenFunctions) {
var ret = callIdent + '(' + args.join(',') + ')';
if (ASM_JS) { // TODO: do only when needed (library functions and Math.*?) XXX && simpleIdent in Functions.libraryFunctions) {
if (ffiCall) {
- ret = asmCoercion(ret, ensureValidFFIType(returnType));
- if (FROUND && returnType === 'float') ret = asmCoercion(ret, 'float'); // receive double, then float it
+ ret = asmFFICoercion(ret, returnType);
} else {
ret = asmCoercion(ret, returnType);
}