1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 17:18:11 +00:00

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
parent 2ef1e7e634
commit 805e6593b9

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