summaryrefslogtreecommitdiff
path: root/Userland
diff options
context:
space:
mode:
authorAli Mohammad Pur <ali.mpfard@gmail.com>2021-07-12 00:09:42 +0430
committerAli Mohammad Pur <Ali.mpfard@gmail.com>2021-07-12 18:42:45 +0430
commitd74eca78aabf2f0cf0afe5b69b704e011c61e672 (patch)
treed2d3335f4a1a1b1026582e2d3c21f558fcf88082 /Userland
parent65355c388b45308154ead6d59de030150d43fff5 (diff)
downloadserenity-d74eca78aabf2f0cf0afe5b69b704e011c61e672.zip
LibWasm: Skip initializing active empty data sections
Diffstat (limited to 'Userland')
-rw-r--r--Userland/Libraries/LibWasm/AbstractMachine/AbstractMachine.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/Userland/Libraries/LibWasm/AbstractMachine/AbstractMachine.cpp b/Userland/Libraries/LibWasm/AbstractMachine/AbstractMachine.cpp
index af4a4dfd09..07a81d7fe9 100644
--- a/Userland/Libraries/LibWasm/AbstractMachine/AbstractMachine.cpp
+++ b/Userland/Libraries/LibWasm/AbstractMachine/AbstractMachine.cpp
@@ -286,6 +286,8 @@ InstantiationResult AbstractMachine::instantiate(Module const& module, Vector<Ex
};
return;
}
+ if (data.init.is_empty())
+ return;
auto address = main_module_instance.memories()[data.index.value()];
if (auto instance = m_store.get(address)) {
if (auto max = instance->type().limits().max(); max.has_value()) {