From e70624de9fe6124b774784576875249641777bd8 Mon Sep 17 00:00:00 2001 From: Ali Mohammad Pur Date: Tue, 23 Aug 2022 16:21:03 +0430 Subject: [PATCH] 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. --- .../LibWeb/WebAssembly/WebAssemblyMemoryConstructor.cpp | 3 --- 1 file changed, 3 deletions(-) diff --git a/Userland/Libraries/LibWeb/WebAssembly/WebAssemblyMemoryConstructor.cpp b/Userland/Libraries/LibWeb/WebAssembly/WebAssemblyMemoryConstructor.cpp index ea8698c57a7f4e..ea23f37cbeb523 100644 --- a/Userland/Libraries/LibWeb/WebAssembly/WebAssemblyMemoryConstructor.cpp +++ b/Userland/Libraries/LibWeb/WebAssembly/WebAssemblyMemoryConstructor.cpp @@ -47,9 +47,6 @@ JS::ThrowCompletionOr WebAssemblyMemoryConstructor::construct(Funct if (!address.has_value()) return vm.throw_completion("Wasm Memory allocation failed"); - if (!WebAssemblyObject::s_abstract_machine.store().get(*address)->grow(initial)) - return vm.throw_completion(String::formatted("Wasm Memory grow failed: {}", initial)); - return vm.heap().allocate(realm, realm, *address); }