From f3d5eb7fab333382627b988275eb95ded5c4b9a6 Mon Sep 17 00:00:00 2001 From: Alon Zakai Date: Fri, 7 Jun 2013 15:38:42 -0700 Subject: fix multiplications in setjmp code --- src/library.js | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'src') 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; } -- cgit v1.2.3-18-g5258