Fill the Refs[Offset : Offset + Length - 1] by Val.
| 138 | |
| 139 | /// Fill the Refs[Offset : Offset + Length - 1] by Val. |
| 140 | Expect<void> fillRefs(const RefVariant &Val, const uint64_t Offset, |
| 141 | const uint64_t Length) noexcept { |
| 142 | // Check the accessing boundary. |
| 143 | if (!checkAccessBound(Offset, Length)) { |
| 144 | spdlog::error(ErrCode::Value::TableOutOfBounds); |
| 145 | spdlog::error(ErrInfo::InfoBoundary(Offset, Length, getSize())); |
| 146 | return Unexpect(ErrCode::Value::TableOutOfBounds); |
| 147 | } |
| 148 | |
| 149 | // Fill the references. |
| 150 | std::fill_n(Refs.begin() + static_cast<std::ptrdiff_t>(Offset), Length, |
| 151 | Val); |
| 152 | return {}; |
| 153 | } |
| 154 | |
| 155 | /// Get the elem address. |
| 156 | Expect<RefVariant> getRefAddr(const uint64_t Idx) const noexcept { |
no test coverage detected