| 42 | } |
| 43 | |
| 44 | Expect<void> Executor::runThrowRefOp(Runtime::StackManager &StackMgr, |
| 45 | const AST::Instruction &Instr, |
| 46 | AST::InstrView::iterator &PC) noexcept { |
| 47 | const auto Ref = StackMgr.pop().get<RefVariant>(); |
| 48 | if (Ref.isNull()) { |
| 49 | spdlog::error(ErrCode::Value::AccessNullException); |
| 50 | spdlog::error( |
| 51 | ErrInfo::InfoInstruction(Instr.getOpCode(), Instr.getOffset())); |
| 52 | return Unexpect(ErrCode::Value::AccessNullException); |
| 53 | } |
| 54 | const auto *ExnInst = Ref.getPtr<Runtime::Instance::ExceptionInstance>(); |
| 55 | auto *TagInst = ExnInst->getTag(); |
| 56 | // Re-push the captured payload to mirror an initial `throw`, then unwind. |
| 57 | StackMgr.pushValVec(ExnInst->getPayload()); |
| 58 | return throwException(StackMgr, *TagInst, PC, ExnInst); |
| 59 | } |
| 60 | |
| 61 | Expect<void> Executor::runBrOp(Runtime::StackManager &StackMgr, |
| 62 | const AST::Instruction &Instr, |
nothing calls this directly
no test coverage detected