summaryrefslogtreecommitdiff
path: root/src/js
diff options
context:
space:
mode:
authorAlon Zakai <alonzakai@gmail.com>2016-03-05 16:45:22 -0800
committerAlon Zakai <alonzakai@gmail.com>2016-03-05 16:45:22 -0800
commit69b457cd2da748175f8fc46312c8f7b40e368205 (patch)
treec6f30dc8fda9edbdeef14d4698ba2d15f5718f0d /src/js
parentd8232efb1664c162f834a3d540d8bbefb7035ec0 (diff)
downloadbinaryen-69b457cd2da748175f8fc46312c8f7b40e368205.tar.gz
binaryen-69b457cd2da748175f8fc46312c8f7b40e368205.tar.bz2
binaryen-69b457cd2da748175f8fc46312c8f7b40e368205.zip
warn when we should grow wasm memory in mergeMemory
Diffstat (limited to 'src/js')
-rw-r--r--src/js/wasm.js-post.js4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/js/wasm.js-post.js b/src/js/wasm.js-post.js
index 762c1bd30..de1ee2752 100644
--- a/src/js/wasm.js-post.js
+++ b/src/js/wasm.js-post.js
@@ -71,7 +71,9 @@ function integrateWasmJS(Module) {
// TODO: avoid this copy, by avoiding such static init writes
// TODO: in shorter term, just copy up to the last static init write
var oldBuffer = Module['buffer'];
- assert(newBuffer.byteLength >= oldBuffer.byteLength, 'we might fail if we allocated more than TOTAL_MEMORY');
+ if (newBuffer.byteLength < oldBuffer.byteLength) {
+ Module['printErr']('the new buffer in mergeMemory is smaller than the previous one. in native wasm, we should grow memory here');
+ }
var oldView = new Int8Array(oldBuffer);
var newView = new Int8Array(newBuffer);
if ({{{ WASM_BACKEND }}}) {