diff options
author | Alon Zakai <alonzakai@gmail.com> | 2013-04-27 20:49:37 -0700 |
---|---|---|
committer | Alon Zakai <alonzakai@gmail.com> | 2013-04-29 13:02:33 -0700 |
commit | 013b20b472fb595b6b0ba2178a6d52694c9f46ea (patch) | |
tree | 7a91ea7e6df8df544e4965345282c17900fcb6ab /src/library.js | |
parent | 7c350b51637a31dd227c398a171a6667c67c8111 (diff) |
fix sscanf, note that all varargs are 64-bit aligned
Diffstat (limited to 'src/library.js')
-rw-r--r-- | src/library.js | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/library.js b/src/library.js index 28724c0c..d276f216 100644 --- a/src/library.js +++ b/src/library.js @@ -2499,7 +2499,7 @@ LibraryManager.library = { for (var formatIndex = 0; formatIndex < format.length;) { if (format[formatIndex] === '%' && format[formatIndex+1] == 'n') { var argPtr = {{{ makeGetValue('varargs', 'argIndex', 'void*') }}}; - argIndex += Runtime.getAlignSize('void*'); + argIndex += Runtime.getAlignSize('void*', null, true); {{{ makeSetValue('argPtr', 0, 'soFar', 'i32') }}}; formatIndex += 2; continue; @@ -2508,7 +2508,7 @@ LibraryManager.library = { // TODO: Support strings like "%5c" etc. if (format[formatIndex] === '%' && format[formatIndex+1] == 'c') { var argPtr = {{{ makeGetValue('varargs', 'argIndex', 'void*') }}}; - argIndex += Runtime.getAlignSize('void*'); + argIndex += Runtime.getAlignSize('void*', null, true); fields++; next = get(); {{{ makeSetValue('argPtr', 0, 'next', 'i8') }}} @@ -2600,7 +2600,7 @@ LibraryManager.library = { var text = buffer.join(''); var argPtr = {{{ makeGetValue('varargs', 'argIndex', 'void*') }}}; - argIndex += Runtime.getAlignSize('void*'); + argIndex += Runtime.getAlignSize('void*', null, true); switch (type) { case 'd': case 'u': case 'i': if (half) { |