| 112 | } |
| 113 | |
| 114 | Expect<void> Executor::runStructNewOp(Runtime::StackManager &StackMgr, |
| 115 | const uint32_t TypeIdx, |
| 116 | const bool IsDefault) const noexcept { |
| 117 | if (IsDefault) { |
| 118 | StackMgr.push(*structNew(StackMgr, TypeIdx)); |
| 119 | } else { |
| 120 | const auto &CompType = getCompositeTypeByIdx(StackMgr, TypeIdx); |
| 121 | const uint32_t N = static_cast<uint32_t>(CompType.getFieldTypes().size()); |
| 122 | std::vector<ValVariant> Vals = StackMgr.pop(N); |
| 123 | StackMgr.push(*structNew(StackMgr, TypeIdx, Vals)); |
| 124 | } |
| 125 | return {}; |
| 126 | } |
| 127 | |
| 128 | Expect<void> Executor::runStructGetOp(Runtime::StackManager &StackMgr, |
| 129 | const uint32_t TypeIdx, |