LibWeb: Don't grow Wasm memory again after initialisation

The constructor grows the memory to the initial size, we don't need to
do that again.
This commit is contained in:
Ali Mohammad Pur 2022-08-23 16:21:03 +04:30 committed by Linus Groh
parent b9fc9aeba1
commit e70624de9f
Notes: sideshowbarker 2024-07-17 07:55:01 +09:00

View file

@ -47,9 +47,6 @@ JS::ThrowCompletionOr<JS::Object*> WebAssemblyMemoryConstructor::construct(Funct
if (!address.has_value())
return vm.throw_completion<JS::TypeError>("Wasm Memory allocation failed");
if (!WebAssemblyObject::s_abstract_machine.store().get(*address)->grow(initial))
return vm.throw_completion<JS::TypeError>(String::formatted("Wasm Memory grow failed: {}", initial));
return vm.heap().allocate<WebAssemblyMemoryObject>(realm, realm, *address);
}