| 28 | } |
| 29 | |
| 30 | Expect<void> Executor::runTableSetOp(Runtime::StackManager &StackMgr, |
| 31 | Runtime::Instance::TableInstance &TabInst, |
| 32 | const AST::Instruction &Instr) { |
| 33 | // Pop Ref from the stack. |
| 34 | RefVariant Ref = StackMgr.pop().get<RefVariant>(); |
| 35 | |
| 36 | // Pop Idx from the stack. |
| 37 | const auto AddrType = TabInst.getTableType().getLimit().getAddrType(); |
| 38 | uint64_t Idx = extractAddr(StackMgr.pop(), AddrType); |
| 39 | |
| 40 | // Set table[Idx] with Ref. |
| 41 | return TabInst.setRefAddr(Idx, Ref).map_error([&Instr, &Idx](auto E) { |
| 42 | spdlog::error(ErrInfo::InfoInstruction(Instr.getOpCode(), Instr.getOffset(), |
| 43 | {Idx}, |
| 44 | {ValTypeFromType<uint32_t>()})); |
| 45 | return E; |
| 46 | }); |
| 47 | } |
| 48 | |
| 49 | Expect<void> |
| 50 | Executor::runTableInitOp(Runtime::StackManager &StackMgr, |
nothing calls this directly
no test coverage detected