diff options
-rw-r--r-- | src/js/wasm.js-post.js | 4 |
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 }}}) { |