| 168 | } |
| 169 | |
| 170 | Expect<void> Executor::runCallRefOp(Runtime::StackManager &StackMgr, |
| 171 | const AST::Instruction &Instr, |
| 172 | AST::InstrView::iterator &PC, |
| 173 | bool IsTailCall) noexcept { |
| 174 | const auto Ref = StackMgr.pop().get<RefVariant>(); |
| 175 | const auto *FuncInst = retrieveFuncRef(Ref); |
| 176 | if (FuncInst == nullptr) { |
| 177 | spdlog::error(ErrCode::Value::AccessNullFunc); |
| 178 | spdlog::error( |
| 179 | ErrInfo::InfoInstruction(Instr.getOpCode(), Instr.getOffset())); |
| 180 | return Unexpect(ErrCode::Value::AccessNullFunc); |
| 181 | } |
| 182 | |
| 183 | // Get Function address. |
| 184 | EXPECTED_TRY(auto NextPC, |
| 185 | enterFunction(StackMgr, *FuncInst, PC + 1, IsTailCall)); |
| 186 | PC = NextPC - 1; |
| 187 | return {}; |
| 188 | } |
| 189 | |
| 190 | Expect<void> Executor::runCallIndirectOp(Runtime::StackManager &StackMgr, |
| 191 | const AST::Instruction &Instr, |
nothing calls this directly
no test coverage detected