| 7 | namespace Executor { |
| 8 | |
| 9 | Expect<void> Executor::runTableGetOp(Runtime::StackManager &StackMgr, |
| 10 | Runtime::Instance::TableInstance &TabInst, |
| 11 | const AST::Instruction &Instr) { |
| 12 | // Pop Idx from the stack. |
| 13 | const auto AddrType = TabInst.getTableType().getLimit().getAddrType(); |
| 14 | uint64_t Idx = extractAddr(StackMgr.pop(), AddrType); |
| 15 | |
| 16 | // Get table[Idx] and push it to the stack. |
| 17 | return TabInst.getRefAddr(Idx) |
| 18 | .map_error([&Instr, &Idx](auto E) { |
| 19 | spdlog::error(ErrInfo::InfoInstruction(Instr.getOpCode(), |
| 20 | Instr.getOffset(), {Idx}, |
| 21 | {ValTypeFromType<uint32_t>()})); |
| 22 | return E; |
| 23 | }) |
| 24 | .and_then([&](auto Ref) -> Expect<void> { |
| 25 | StackMgr.push(Ref); |
| 26 | return {}; |
| 27 | }); |
| 28 | } |
| 29 | |
| 30 | Expect<void> Executor::runTableSetOp(Runtime::StackManager &StackMgr, |
| 31 | Runtime::Instance::TableInstance &TabInst, |
nothing calls this directly
no test coverage detected