aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlon Zakai <alonzakai@gmail.com>2013-01-07 16:12:26 -0800
committerAlon Zakai <alonzakai@gmail.com>2013-01-07 16:12:26 -0800
commitfe0d110de9ed7eaf58a321b4be66b89bb951abc9 (patch)
tree582a880b96f287ba6723c9a06157005f396ee70a
parent680d3f7de3dba6c6210350718bf6c99dfc504df0 (diff)
do not asm coerce values of type void (e.g. functions that return nothing)
-rw-r--r--src/parseTools.js4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/parseTools.js b/src/parseTools.js
index bcae838a..89267d10 100644
--- a/src/parseTools.js
+++ b/src/parseTools.js
@@ -1016,7 +1016,9 @@ function asmInitializer(type, impl) {
function asmCoercion(value, type) {
if (!ASM_JS) return value;
- if (isIntImplemented(type)) {
+ if (type == 'void') {
+ return value;
+ } else if (isIntImplemented(type)) {
return '((' + value + ')|0)';
} else {
return '(+(' + value + '))';