Allow memory size of 2GB

This commit is contained in:
Fabian 2020-12-31 19:14:33 -06:00
parent e981114dd7
commit 4a90ec6256
2 changed files with 5 additions and 0 deletions

View file

@ -21,6 +21,8 @@ var ASYNC_SAFE = false;
// Reads len characters at offset from Memory object mem as a JS string
v86util.read_sized_string_from_mem = function read_sized_string_from_mem(mem, offset, len)
{
offset >>>= 0;
len >>>= 0;
return String.fromCharCode(...new Uint8Array(mem.buffer, offset, len));
};

View file

@ -1324,6 +1324,9 @@ var seen_code_uncompiled = {};
CPU.prototype.codegen_finalize = function(wasm_table_index, start, state_flags, ptr, len)
{
ptr >>>= 0;
len >>>= 0;
dbg_assert(wasm_table_index >= 0 && wasm_table_index < WASM_TABLE_SIZE);
const code = new Uint8Array(this.wm.instance.exports.memory.buffer, ptr, len);