aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlon Zakai <alonzakai@gmail.com>2013-06-20 09:45:32 -0700
committerAlon Zakai <alonzakai@gmail.com>2013-06-20 10:02:31 -0700
commitf2121fe18499cd09b870a1bd8ef5f3259a806d28 (patch)
treefd83d5b1733e5aa1e09463df6c1b9fbbf7f41535
parentf7e14034b7b3561c1570b81b3209f93a0b85b716 (diff)
ensure a coercion on invoke calls
-rw-r--r--src/jsifier.js7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/jsifier.js b/src/jsifier.js
index 88b9d9f6..e9bc9a79 100644
--- a/src/jsifier.js
+++ b/src/jsifier.js
@@ -1185,8 +1185,13 @@ function JSify(data, functionsOnly, givenFunctions) {
if (disabled) {
ret = call_ + ';';
} else if (ASM_JS) {
+ if (item.type != 'void') call_ = asmCoercion(call_, item.type); // ensure coercion to ffi in comma operator
call_ = call_.replace('; return', ''); // we auto-add returns when aborting, but do not need them here
- ret = '(__THREW__ = 0,' + call_ + ');';
+ if (item.type == 'void') {
+ ret = '__THREW__ = 0;' + call_ + ';';
+ } else {
+ ret = '(__THREW__ = 0,' + call_ + ');';
+ }
} else {
ret = '(function() { try { __THREW__ = 0; return '
+ call_ + ' '