MCPcopy Create free account
hub / github.com/WasmEdge/WasmEdge / runCallRefOp

Method runCallRefOp

lib/executor/engine/controlInstr.cpp:170–188  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

168}
169
170Expect<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
190Expect<void> Executor::runCallIndirectOp(Runtime::StackManager &StackMgr,
191 const AST::Instruction &Instr,

Callers

nothing calls this directly

Calls 7

retrieveFuncRefFunction · 0.85
InfoInstructionClass · 0.85
UnexpectFunction · 0.85
popMethod · 0.80
errorFunction · 0.50
getOpCodeMethod · 0.45
getOffsetMethod · 0.45

Tested by

no test coverage detected