Helper: call memory.copy(dst, src, len).
| 124 | |
| 125 | /// Helper: call memory.copy(dst, src, len). |
| 126 | static void memoryCopy(VM::VM &VM, uint32_t Dst, uint32_t Src, uint32_t Len) { |
| 127 | std::vector<ValVariant> Params = {Dst, Src, Len}; |
| 128 | std::vector<ValType> ParamTypes = {I32Type, I32Type, I32Type}; |
| 129 | auto Res = VM.execute("copy", Params, ParamTypes); |
| 130 | ASSERT_TRUE(Res) << "memory.copy failed: dst=" << Dst << " src=" << Src |
| 131 | << " len=" << Len; |
| 132 | } |
| 133 | |
| 134 | /// Helper: read a range of bytes from memory. |
| 135 | static std::vector<uint8_t> readMemory(VM::VM &VM, uint32_t Start, |