From aafef1e92d8e750b8abd2100e5896df75505e2a1 Mon Sep 17 00:00:00 2001 From: Ali Mohammad Pur Date: Sat, 8 Jul 2023 13:50:40 +0330 Subject: [PATCH] LibWasm: Make the main module's functions addressable by globals --- .../LibWasm/AbstractMachine/AbstractMachine.cpp | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/Userland/Libraries/LibWasm/AbstractMachine/AbstractMachine.cpp b/Userland/Libraries/LibWasm/AbstractMachine/AbstractMachine.cpp index fe01816ef3..1736a159bb 100644 --- a/Userland/Libraries/LibWasm/AbstractMachine/AbstractMachine.cpp +++ b/Userland/Libraries/LibWasm/AbstractMachine/AbstractMachine.cpp @@ -162,6 +162,13 @@ InstantiationResult AbstractMachine::instantiate(Module const& module, Vector([&](auto& global_section) { @@ -399,12 +406,6 @@ Optional AbstractMachine::allocate_all_initial_phase(Module // FIXME: What if this fails? - for (auto& func : module.functions()) { - auto address = m_store.allocate(module_instance, func); - VERIFY(address.has_value()); - module_instance.functions().append(*address); - } - module.for_each_section_of_type([&](TableSection const& section) { for (auto& table : section.tables()) { auto table_address = m_store.allocate(table.type());