MCPcopy Create free account
hub / github.com/WasmEdge/WasmEdge / loadByte

Function loadByte

test/meminstance/MemInstanceTest.cpp:117–123  ·  view source on GitHub ↗

Helper: load a byte from the given address.

Source from the content-addressed store, hash-verified

115
116/// Helper: load a byte from the given address.
117static uint32_t loadByte(VM::VM &VM, uint32_t Addr) {
118 std::vector<ValVariant> Params = {Addr};
119 std::vector<ValType> ParamTypes = {I32Type};
120 auto Res = VM.execute("load8", Params, ParamTypes);
121 EXPECT_TRUE(Res) << "load8 failed at addr=" << Addr;
122 return (*Res)[0].first.get<uint32_t>();
123}
124
125/// Helper: call memory.copy(dst, src, len).
126static void memoryCopy(VM::VM &VM, uint32_t Dst, uint32_t Src, uint32_t Len) {

Callers 2

readMemoryFunction · 0.85
TEST_FFunction · 0.85

Calls 1

executeMethod · 0.45

Tested by

no test coverage detected