| 190 | } |
| 191 | |
| 192 | Expect<void> |
| 193 | Executor::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 | |
| 210 | Expect<void> Executor::runArrayGetOp(Runtime::StackManager &StackMgr, |
| 211 | const uint32_t TypeIdx, |