aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlon Zakai <alonzakai@gmail.com>2013-01-08 13:51:02 -0800
committerAlon Zakai <alonzakai@gmail.com>2013-01-08 13:51:02 -0800
commit4379d19dc217376bb11e9c4172c84ac194409c3c (patch)
tree4e8aae9585aba0781ea651e72e58fb7b0c20b249
parent3a866bd0b3dc95e030b6b04d6a3534d4ac8b57e6 (diff)
ensure a return when an abort happens in a function that returns something
-rw-r--r--src/jsifier.js3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/jsifier.js b/src/jsifier.js
index 24af5b6d..e57facbd 100644
--- a/src/jsifier.js
+++ b/src/jsifier.js
@@ -1329,6 +1329,9 @@ function JSify(data, functionsOnly, givenFunctions) {
var ret = ident + '(' + args.join(', ') + ')';
if (ASM_JS) { // TODO: do only when needed (library functions and Math.*?) XXX && shortident in Functions.libraryFunctions) {
ret = asmCoercion(ret, returnType);
+ if (shortident == 'abort' && funcData.returnType != 'void') {
+ ret += '; return 0'; // special case: abort() can happen without return, breaking the return type of asm functions. ensure a return
+ }
}
return ret;
}