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

Method runArrayNewElemOp

lib/executor/engine/refInstr.cpp:192–208  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

190}
191
192Expect<void>
193Executor::runArrayNewElemOp(Runtime::StackManager &StackMgr,
194 const uint32_t TypeIdx, const uint32_t ElemIdx,
195 const AST::Instruction &Instr) const noexcept {
196 const uint32_t Length = StackMgr.pop().get<uint32_t>();
197 const uint32_t Start = StackMgr.getTop().get<uint32_t>();
198 EXPECTED_TRY(auto InstRef,
199 arrayNewElem(StackMgr, TypeIdx, ElemIdx, Start, Length)
200 .map_error([&](auto E) {
201 auto *ElemInst = getElemInstByIdx(StackMgr, ElemIdx);
202 return logError(E, Instr, [&]() {
203 return logTableOOB(E, *ElemInst, Start, Length);
204 });
205 }));
206 StackMgr.getTop().emplace<RefVariant>(InstRef);
207 return {};
208}
209
210Expect<void> Executor::runArrayGetOp(Runtime::StackManager &StackMgr,
211 const uint32_t TypeIdx,

Callers

nothing calls this directly

Calls 1

popMethod · 0.80

Tested by

no test coverage detected