aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAlon Zakai <alonzakai@gmail.com>2013-06-07 15:38:42 -0700
committerAlon Zakai <alonzakai@gmail.com>2013-06-07 15:38:42 -0700
commitf3d5eb7fab333382627b988275eb95ded5c4b9a6 (patch)
treeb4f3251f6310cc2cc6a5ff2dbf06f25687ba393a /src
parent507d73ae7b6964031c3090e9330fb50c009df7c1 (diff)
fix multiplications in setjmp code
Diffstat (limited to 'src')
-rw-r--r--src/library.js12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/library.js b/src/library.js
index 2578fda4..a24ce3ca 100644
--- a/src/library.js
+++ b/src/library.js
@@ -6374,11 +6374,11 @@ LibraryManager.library = {
setjmpId = (setjmpId+1)|0;
{{{ makeSetValueAsm('env', '0', 'setjmpId', 'i32') }}};
while ((i|0) < {{{ 2*MAX_SETJMPS }}}) {
- if ({{{ makeGetValueAsm('table', 'i*4', 'i32') }}} == 0) {
- {{{ makeSetValueAsm('table', 'i*4', 'setjmpId', 'i32') }}};
- {{{ makeSetValueAsm('table', 'i*4+4', 'label', 'i32') }}};
+ if ({{{ makeGetValueAsm('table', '(i<<2)', 'i32') }}} == 0) {
+ {{{ makeSetValueAsm('table', '(i<<2)', 'setjmpId', 'i32') }}};
+ {{{ makeSetValueAsm('table', '(i<<2)+4', 'label', 'i32') }}};
// prepare next slot
- {{{ makeSetValueAsm('table', 'i*4+8', '0', 'i32') }}};
+ {{{ makeSetValueAsm('table', '(i<<2)+8', '0', 'i32') }}};
return 0;
}
i = (i+2)|0;
@@ -6395,10 +6395,10 @@ LibraryManager.library = {
table = table|0;
var i = 0, curr = 0;
while ((i|0) < {{{ MAX_SETJMPS }}}) {
- curr = {{{ makeGetValueAsm('table', 'i*4', 'i32') }}};
+ curr = {{{ makeGetValueAsm('table', '(i<<2)', 'i32') }}};
if ((curr|0) == 0) break;
if ((curr|0) == (id|0)) {
- return {{{ makeGetValueAsm('table', 'i*4+4', 'i32') }}};
+ return {{{ makeGetValueAsm('table', '(i<<2)+4', 'i32') }}};
}
i = (i+2)|0;
}