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

Method runI31GetOp

lib/executor/engine/refInstr.cpp:396–410  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

394}
395
396Expect<void> Executor::runI31GetOp(ValVariant &Val,
397 const AST::Instruction &Instr,
398 const bool IsSigned) const noexcept {
399 uint32_t RefNum = static_cast<uint32_t>(
400 reinterpret_cast<uintptr_t>(Val.get<RefVariant>().getPtr<void>()));
401 if ((RefNum & 0x80000000U) == 0) {
402 return Unexpect(logError(ErrCode::Value::AccessNullI31, Instr));
403 }
404 RefNum &= 0x7FFFFFFFU;
405 if (IsSigned) {
406 RefNum |= ((RefNum & 0x40000000U) << 1);
407 }
408 Val.emplace<uint32_t>(RefNum);
409 return {};
410}
411
412Expect<RefVariant>
413Executor::structNew(Runtime::StackManager &StackMgr, const uint32_t TypeIdx,

Callers

nothing calls this directly

Calls 2

UnexpectFunction · 0.85
logErrorFunction · 0.85

Tested by

no test coverage detected