| 99 | } |
| 100 | |
| 101 | Expect<void> |
| 102 | Executor::runTableGrowOp(Runtime::StackManager &StackMgr, |
| 103 | Runtime::Instance::TableInstance &TabInst) { |
| 104 | // Pop N for the growing size and Val for the initial reference value. |
| 105 | const auto AddrType = TabInst.getTableType().getLimit().getAddrType(); |
| 106 | uint64_t N = extractAddr(StackMgr.pop(), AddrType); |
| 107 | RefVariant Ref = StackMgr.pop().get<RefVariant>(); |
| 108 | |
| 109 | // Grow size and push result. |
| 110 | const uint64_t CurrSize = TabInst.getSize(); |
| 111 | if (TabInst.growTable(N, Ref)) { |
| 112 | StackMgr.push(emplaceAddr(CurrSize, AddrType)); |
| 113 | } else { |
| 114 | StackMgr.push(emplaceAddr(static_cast<uint64_t>(-1), AddrType)); |
| 115 | } |
| 116 | return {}; |
| 117 | } |
| 118 | |
| 119 | Expect<void> |
| 120 | Executor::runTableSizeOp(Runtime::StackManager &StackMgr, |
nothing calls this directly
no test coverage detected