summaryrefslogtreecommitdiff
path: root/Userland/Libraries
diff options
context:
space:
mode:
authorLuke Wilde <lukew@serenityos.org>2022-10-28 06:00:15 +0100
committerAli Mohammad Pur <Ali.mpfard@gmail.com>2022-10-28 10:27:02 +0330
commit805e6593b999dd99ebcbd5205481bda5b0bb26f5 (patch)
tree96b534e861b2f9babe6864b7852409bdad0a994c /Userland/Libraries
parent2ef1e7e634f0b15ddf68008b0c8c453fa0b4a4bc (diff)
downloadserenity-805e6593b999dd99ebcbd5205481bda5b0bb26f5.zip
LibWasm: Add missing validation for memory.copy
This has the exact same validation as memory.fill
Diffstat (limited to 'Userland/Libraries')
-rw-r--r--Userland/Libraries/LibWasm/AbstractMachine/Validator.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/Userland/Libraries/LibWasm/AbstractMachine/Validator.cpp b/Userland/Libraries/LibWasm/AbstractMachine/Validator.cpp
index fc512253db..56cba381e0 100644
--- a/Userland/Libraries/LibWasm/AbstractMachine/Validator.cpp
+++ b/Userland/Libraries/LibWasm/AbstractMachine/Validator.cpp
@@ -1887,6 +1887,15 @@ VALIDATE_INSTRUCTION(memory_fill)
return {};
}
+VALIDATE_INSTRUCTION(memory_copy)
+{
+ TRY(validate(MemoryIndex { 0 }));
+
+ TRY((stack.take<ValueType::I32, ValueType::I32, ValueType::I32>()));
+
+ return {};
+}
+
VALIDATE_INSTRUCTION(memory_init)
{
TRY(validate(MemoryIndex { 0 }));