The js backend should better handle OOM
hhugo opened this issue · 0 comments
hhugo commented
The reserve
function in loader.js
doesn't check that there is enough memory before returning.
This can result in the following error when accessing the "reserved" memory.
RangeError: offset is out of bounds
This was spotted using hacl-star
with large input.
- consider dynamically growing the memory buffer (see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/WebAssembly/Memory/grow)
- make
reserve
raise a proper OOM error.