diff options
author | Alon Zakai <alonzakai@gmail.com> | 2016-11-10 16:46:57 -0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-11-10 16:46:57 -0800 |
commit | d0ee29345f9c697073d5dee7949dae0ee45be836 (patch) | |
tree | 4f7a9e9feb8d38dd0a8a20308bc1b3285bb8bf5b /src/js | |
parent | a3afc150c3768b351434c734448b7ab456d17f57 (diff) | |
download | binaryen-d0ee29345f9c697073d5dee7949dae0ee45be836.tar.gz binaryen-d0ee29345f9c697073d5dee7949dae0ee45be836.tar.bz2 binaryen-d0ee29345f9c697073d5dee7949dae0ee45be836.zip |
show a warning with guidance when a memory size incompatibility issue makes wasm compilation fail (#834)
Diffstat (limited to 'src/js')
-rw-r--r-- | src/js/wasm.js-post.js | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/js/wasm.js-post.js b/src/js/wasm.js-post.js index a4bc35f97..1fc0509cb 100644 --- a/src/js/wasm.js-post.js +++ b/src/js/wasm.js-post.js @@ -186,6 +186,9 @@ function integrateWasmJS(Module) { instance = new WebAssembly.Instance(new WebAssembly.Module(getBinary()), info) } catch (e) { Module['printErr']('failed to compile wasm module: ' + e); + if (e.toString().indexOf('imported Memory with incompatible size') >= 0) { + Module['printErr']('Memory size incompatibility issues may be due to changing TOTAL_MEMORY at runtime to something too large. Use ALLOW_MEMORY_GROWTH to allow any size memory (and also make sure not to set TOTAL_MEMORY at runtime to something smaller than it was at compile time).'); + } return false; } exports = instance.exports; |