diff options
-rw-r--r-- | src/preamble.js | 11 | ||||
-rw-r--r-- | src/relooper/emscripten/glue.js | 8 | ||||
-rw-r--r-- | tools/shared.py | 2 |
3 files changed, 16 insertions, 5 deletions
diff --git a/src/preamble.js b/src/preamble.js index 8e70cb74..acff665f 100644 --- a/src/preamble.js +++ b/src/preamble.js @@ -908,6 +908,17 @@ function writeArrayToMemory(array, buffer) { } Module['writeArrayToMemory'] = writeArrayToMemory; +function writeAsciiToMemory(str, buffer, dontAddNull) { + for (var i = 0; i < str.length; i++) { +#if ASSERTIONS + assert(str.charCodeAt(i) === str.charCodeAt(i)&0xff); +#endif + {{{ makeSetValue('buffer', 'i', 'str.charCodeAt(i)', 'i8') }}} + } + if (!dontAddNull) {{{ makeSetValue('buffer', 'str.length', 0, 'i8') }}} +} +Module['writeAsciiToMemory'] = writeAsciiToMemory; + {{{ unSign }}} {{{ reSign }}} diff --git a/src/relooper/emscripten/glue.js b/src/relooper/emscripten/glue.js index f5b9e142..587cf529 100644 --- a/src/relooper/emscripten/glue.js +++ b/src/relooper/emscripten/glue.js @@ -19,10 +19,10 @@ RelooperGlue['addBlock'] = function(text, branchVar) { assert(this.r); assert(text.length+1 < TBUFFER_SIZE, 'buffer too small, increase RELOOPER_BUFFER_SIZE'); - writeStringToMemory(text, tbuffer); + writeAsciiToMemory(text, tbuffer); if (branchVar) { assert(branchVar.length+1 < VBUFFER_SIZE, 'buffer too small, increase RELOOPER_BUFFER_SIZE'); - writeStringToMemory(branchVar, vbuffer); + writeAsciiToMemory(branchVar, vbuffer); } var b = _rl_new_block(tbuffer, branchVar ? vbuffer : 0); _rl_relooper_add_block(this.r, b); @@ -32,14 +32,14 @@ assert(this.r); if (condition) { assert(condition.length+1 < TBUFFER_SIZE/2, 'buffer too small, increase RELOOPER_BUFFER_SIZE'); - writeStringToMemory(condition, tbuffer); + writeAsciiToMemory(condition, tbuffer); condition = tbuffer; } else { condition = 0; // allow undefined, null, etc. as inputs } if (code) { assert(code.length+1 < TBUFFER_SIZE/2, 'buffer too small, increase RELOOPER_BUFFER_SIZE'); - writeStringToMemory(code, tbuffer + TBUFFER_SIZE/2); + writeAsciiToMemory(code, tbuffer + TBUFFER_SIZE/2); code = tbuffer + TBUFFER_SIZE/2; } else { code = 0; // allow undefined, null, etc. as inputs diff --git a/tools/shared.py b/tools/shared.py index d605dee9..4e1a3ebf 100644 --- a/tools/shared.py +++ b/tools/shared.py @@ -304,7 +304,7 @@ def find_temp_directory(): # we re-check sanity when the settings are changed) # We also re-check sanity and clear the cache when the version changes -EMSCRIPTEN_VERSION = '1.6.0' +EMSCRIPTEN_VERSION = '1.6.1' def generate_sanity(): return EMSCRIPTEN_VERSION + '|' + get_llvm_target() + '|' + LLVM_ROOT |