| 249 | size_t currentOffset() const { return offset; } |
| 250 | |
| 251 | LogicalResult skipPadding(uint64_t alignment) { |
| 252 | if (alignment < 2) |
| 253 | return success(); |
| 254 | if (remaining() == 0) |
| 255 | return failure(); |
| 256 | size_t offset_position = this->currentOffset(); |
| 257 | size_t padding = (alignment - (offset_position % alignment)) % alignment; |
| 258 | if (remaining() < padding) |
| 259 | return failure(); |
| 260 | return skip(padding); |
| 261 | } |
| 262 | |
| 263 | // Emits an error message associated with the current reader offset. |
| 264 | // TODO: Generate a location based on the current offset instead of |
no test coverage detected