Helper: store a byte at the given address.
| 107 | |
| 108 | /// Helper: store a byte at the given address. |
| 109 | static void storeByte(VM::VM &VM, uint32_t Addr, uint32_t Val) { |
| 110 | std::vector<ValVariant> Params = {Addr, Val}; |
| 111 | std::vector<ValType> ParamTypes = {I32Type, I32Type}; |
| 112 | auto Res = VM.execute("store8", Params, ParamTypes); |
| 113 | ASSERT_TRUE(Res) << "store8 failed at addr=" << Addr; |
| 114 | } |
| 115 | |
| 116 | /// Helper: load a byte from the given address. |
| 117 | static uint32_t loadByte(VM::VM &VM, uint32_t Addr) { |