diff options
author | Linus Groh <mail@linusgroh.de> | 2022-12-14 17:40:33 +0000 |
---|---|---|
committer | Tim Flynn <trflynn89@pm.me> | 2022-12-15 06:56:37 -0500 |
commit | 22089436edec780e03960ecaa74bfc4930126534 (patch) | |
tree | f60662c28d36e8fcce4b734e09af396c68ed1aaf /Userland/Libraries/LibWeb/WebAssembly | |
parent | 2a66fc6cae8ef09e780cd795bf0b1d7f8844f4ec (diff) | |
download | serenity-22089436edec780e03960ecaa74bfc4930126534.zip |
LibJS: Convert Heap::allocate{,_without_realm}() to NonnullGCPtr
Diffstat (limited to 'Userland/Libraries/LibWeb/WebAssembly')
4 files changed, 4 insertions, 4 deletions
diff --git a/Userland/Libraries/LibWeb/WebAssembly/WebAssemblyInstanceConstructor.cpp b/Userland/Libraries/LibWeb/WebAssembly/WebAssemblyInstanceConstructor.cpp index 0f40dd5429..026f633d7c 100644 --- a/Userland/Libraries/LibWeb/WebAssembly/WebAssemblyInstanceConstructor.cpp +++ b/Userland/Libraries/LibWeb/WebAssembly/WebAssemblyInstanceConstructor.cpp @@ -36,7 +36,7 @@ JS::ThrowCompletionOr<JS::Object*> WebAssemblyInstanceConstructor::construct(Fun return vm.throw_completion<JS::TypeError>(JS::ErrorType::NotAnObjectOfType, "WebAssembly.Module"); auto& module_object = static_cast<WebAssemblyModuleObject&>(*module_argument); auto result = TRY(WebAssemblyObject::instantiate_module(vm, module_object.module())); - return heap().allocate<WebAssemblyInstanceObject>(realm, realm, result); + return heap().allocate<WebAssemblyInstanceObject>(realm, realm, result).ptr(); } void WebAssemblyInstanceConstructor::initialize(JS::Realm& realm) diff --git a/Userland/Libraries/LibWeb/WebAssembly/WebAssemblyMemoryConstructor.cpp b/Userland/Libraries/LibWeb/WebAssembly/WebAssemblyMemoryConstructor.cpp index 1cde4c1994..01beff4b04 100644 --- a/Userland/Libraries/LibWeb/WebAssembly/WebAssemblyMemoryConstructor.cpp +++ b/Userland/Libraries/LibWeb/WebAssembly/WebAssemblyMemoryConstructor.cpp @@ -46,7 +46,7 @@ JS::ThrowCompletionOr<JS::Object*> WebAssemblyMemoryConstructor::construct(Funct if (!address.has_value()) return vm.throw_completion<JS::TypeError>("Wasm Memory allocation failed"); - return vm.heap().allocate<WebAssemblyMemoryObject>(realm, realm, *address); + return vm.heap().allocate<WebAssemblyMemoryObject>(realm, realm, *address).ptr(); } void WebAssemblyMemoryConstructor::initialize(JS::Realm& realm) diff --git a/Userland/Libraries/LibWeb/WebAssembly/WebAssemblyModuleConstructor.cpp b/Userland/Libraries/LibWeb/WebAssembly/WebAssemblyModuleConstructor.cpp index 17c985ff3c..2ffba3ebf6 100644 --- a/Userland/Libraries/LibWeb/WebAssembly/WebAssemblyModuleConstructor.cpp +++ b/Userland/Libraries/LibWeb/WebAssembly/WebAssemblyModuleConstructor.cpp @@ -33,7 +33,7 @@ JS::ThrowCompletionOr<JS::Object*> WebAssemblyModuleConstructor::construct(Funct auto* buffer_object = TRY(vm.argument(0).to_object(vm)); auto result = TRY(parse_module(vm, buffer_object)); - return heap().allocate<WebAssemblyModuleObject>(realm, realm, result); + return heap().allocate<WebAssemblyModuleObject>(realm, realm, result).ptr(); } void WebAssemblyModuleConstructor::initialize(JS::Realm& realm) diff --git a/Userland/Libraries/LibWeb/WebAssembly/WebAssemblyTableConstructor.cpp b/Userland/Libraries/LibWeb/WebAssembly/WebAssemblyTableConstructor.cpp index ca14bc3d8b..2a0db96664 100644 --- a/Userland/Libraries/LibWeb/WebAssembly/WebAssemblyTableConstructor.cpp +++ b/Userland/Libraries/LibWeb/WebAssembly/WebAssemblyTableConstructor.cpp @@ -77,7 +77,7 @@ JS::ThrowCompletionOr<JS::Object*> WebAssemblyTableConstructor::construct(Functi for (auto& element : table.elements()) element = reference; - return vm.heap().allocate<WebAssemblyTableObject>(realm, realm, *address); + return vm.heap().allocate<WebAssemblyTableObject>(realm, realm, *address).ptr(); } void WebAssemblyTableConstructor::initialize(JS::Realm& realm) |