diff options
author | Alon Zakai <alonzakai@gmail.com> | 2012-12-07 15:51:06 -0800 |
---|---|---|
committer | Alon Zakai <alonzakai@gmail.com> | 2012-12-07 15:51:06 -0800 |
commit | 8129e120edabbb0fcae7447b8dff08ad0fc3d6f0 (patch) | |
tree | 29b6901da0dfe908362329bb54f34f5f6c31c8da /src | |
parent | 1f4842db0437edb73896e0d7a03558c5a2c692ba (diff) |
emit asm coercions on returns
Diffstat (limited to 'src')
-rw-r--r-- | src/jsifier.js | 2 | ||||
-rw-r--r-- | src/parseTools.js | 1 |
2 files changed, 2 insertions, 1 deletions
diff --git a/src/jsifier.js b/src/jsifier.js index 7e66d426..b51fc1dd 100644 --- a/src/jsifier.js +++ b/src/jsifier.js @@ -1076,7 +1076,7 @@ function JSify(data, functionsOnly, givenFunctions) { } ret += 'return'; if (item.value) { - ret += ' ' + finalizeLLVMParameter(item.value); + ret += ' ' + asmCoercion(finalizeLLVMParameter(item.value), item.type); } return ret + ';'; }); diff --git a/src/parseTools.js b/src/parseTools.js index 91242861..13839d17 100644 --- a/src/parseTools.js +++ b/src/parseTools.js @@ -995,6 +995,7 @@ function asmInitializer(type, impl) { } function asmCoercion(value, type) { + if (!ASM_JS) return value; if (isIntImplemented(type)) { return '((' + value + ')|0)'; } else { |