LibWasm: Add missing validation for memory.copy

This has the exact same validation as memory.fill
This commit is contained in:
Luke Wilde 2022-10-28 06:00:15 +01:00 committed by Ali Mohammad Pur
commit 805e6593b9
Notes: sideshowbarker 2024-07-17 10:54:57 +09:00

View file

@ -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 }));