mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-07-28 11:49:44 +00: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.
This commit is contained in:
parent
d07cf26894
commit
420a626554
Notes:
sideshowbarker
2024-07-17 02:21:14 +09:00
Author: https://github.com/dzfrias
Commit: 420a626554
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/563
Reviewed-by: https://github.com/alimpfard ✅
2 changed files with 16 additions and 3 deletions
|
@ -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());
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue