Skip to content

Commit

Permalink
LibWeb/WebAssembly: Add missing visit of WebAssembly::Memory::m_buffer
Browse files Browse the repository at this point in the history
  • Loading branch information
awesomekling committed Apr 5, 2024
1 parent db31fa7 commit 8aa98b7
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
6 changes: 6 additions & 0 deletions Userland/Libraries/LibWeb/WebAssembly/Memory.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,12 @@ void Memory::initialize(JS::Realm& realm)
WEB_SET_PROTOTYPE_FOR_INTERFACE_WITH_CUSTOM_NAME(Memory, WebAssembly.Memory);
}

void Memory::visit_edges(Visitor& visitor)
{
Base::visit_edges(visitor);
visitor.visit(m_buffer);
}

// https://webassembly.github.io/spec/js-api/#dom-memory-grow
WebIDL::ExceptionOr<u32> Memory::grow(u32 delta)
{
Expand Down
1 change: 1 addition & 0 deletions Userland/Libraries/LibWeb/WebAssembly/Memory.h
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ class Memory : public Bindings::PlatformObject {
Memory(JS::Realm&, Wasm::MemoryAddress);

virtual void initialize(JS::Realm&) override;
virtual void visit_edges(Visitor&) override;

WebIDL::ExceptionOr<void> reset_the_memory_buffer();
static WebIDL::ExceptionOr<JS::NonnullGCPtr<JS::ArrayBuffer>> create_a_memory_buffer(JS::VM&, JS::Realm&, Wasm::MemoryAddress);
Expand Down

0 comments on commit 8aa98b7

Please sign in to comment.