mirror of
https://github.com/SerenityOS/serenity
synced 2026-05-01 03:47:48 +02:00
LibWasm: Make memory.grow grow the memory's type
After a `memory.grow`, the type of the memory instance should be updated so potential memory imports on the boundary are unlinkable. (cherry picked from commit cdb6e834a1c0eaa6e62a9018026a599916332ab3)
This commit is contained in:
@@ -66,7 +66,7 @@ WebIDL::ExceptionOr<u32> Memory::grow(u32 delta)
|
||||
return vm.throw_completion<JS::RangeError>("Could not find the memory instance to grow"sv);
|
||||
|
||||
auto previous_size = memory->size() / Wasm::Constants::page_size;
|
||||
if (!memory->grow(delta * Wasm::Constants::page_size, Wasm::MemoryInstance::InhibitGrowCallback::Yes))
|
||||
if (!memory->grow(delta * Wasm::Constants::page_size, Wasm::MemoryInstance::GrowType::No, Wasm::MemoryInstance::InhibitGrowCallback::Yes))
|
||||
return vm.throw_completion<JS::RangeError>("Memory.grow() grows past the stated limit of the memory instance"sv);
|
||||
|
||||
TRY(reset_the_memory_buffer());
|
||||
|
||||
Reference in New Issue
Block a user