aboutsummaryrefslogtreecommitdiff
path: root/src/runtime.js
diff options
context:
space:
mode:
authorAlon Zakai <alonzakai@gmail.com>2013-06-19 15:08:10 -0700
committerAlon Zakai <alonzakai@gmail.com>2013-06-19 15:20:54 -0700
commitea9efe32c9cc66bcbbdb15a1c33bf10dfbe821c5 (patch)
tree42eca8799db750aa01166d2c6640baed1db20d94 /src/runtime.js
parente4f8c8184058d8d621d8f3ac007a0d1a55980832 (diff)
keep |0 on function calls, allow other bitwise ops on heap accesses etc.
Diffstat (limited to 'src/runtime.js')
-rw-r--r--src/runtime.js6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/runtime.js b/src/runtime.js
index 9bedfe68..e6d5f962 100644
--- a/src/runtime.js
+++ b/src/runtime.js
@@ -25,7 +25,7 @@ var RuntimeGenerator = {
sep = sep || ';';
var ret = RuntimeGenerator.alloc(size, 'STACK', false, sep, USE_TYPED_ARRAYS != 2 || (isNumber(size) && parseInt(size) % {{{ STACK_ALIGN }}} == 0));
if (ASSERTIONS) {
- ret += sep + 'assert(' + asmCoercion('(STACKTOP|0) < (STACK_MAX|0)', 'i32') + ')';
+ ret += sep + '(assert(' + asmCoercion('(STACKTOP|0) < (STACK_MAX|0)', 'i32') + ')|0)';
}
return ret;
},
@@ -37,11 +37,11 @@ var RuntimeGenerator = {
if (USE_TYPED_ARRAYS == 2) {
assert(initial % Runtime.STACK_ALIGN == 0);
if (ASSERTIONS && Runtime.STACK_ALIGN == 4) {
- ret += '; assert(' + asmCoercion('!(STACKTOP&3)', 'i32') + ')';
+ ret += '; (assert(' + asmCoercion('!(STACKTOP&3)', 'i32') + ')|0)';
}
}
if (ASSERTIONS) {
- ret += '; assert(' + asmCoercion('(STACKTOP|0) < (STACK_MAX|0)', 'i32') + ')';
+ ret += '; (assert(' + asmCoercion('(STACKTOP|0) < (STACK_MAX|0)', 'i32') + ')|0)';
}
if (false) {
ret += '; _memset(' + asmCoercion('__stackBase__', 'i32') + ', 0, ' + initial + ')';