summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/js/binaryen.js-post.js2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/js/binaryen.js-post.js b/src/js/binaryen.js-post.js
index 86b063c0e..49a8d2b69 100644
--- a/src/js/binaryen.js-post.js
+++ b/src/js/binaryen.js-post.js
@@ -2597,7 +2597,7 @@ function wrapModule(module, self = {}) {
const ptr = _malloc(size);
Module['_BinaryenCopyMemorySegmentData'](module, id, ptr);
const res = new Uint8Array(size);
- res.set(new Uint8Array(buffer, ptr, size));
+ res.set(HEAP8.subarray(ptr, ptr + size));
_free(ptr);
return res.buffer;
})(),