Skip to content

Commit

Permalink
Tidy assertions in validate_header
Browse files Browse the repository at this point in the history
  • Loading branch information
pdobacz committed Jun 26, 2024
1 parent 8251d34 commit 91f9a88
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions lib/evmone/eof.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -782,9 +782,12 @@ std::variant<EOF1Header, EOFValidationError> validate_header(
std::vector<uint16_t> container_offsets;
for (const auto container_size : container_sizes)
{
assert(offset <= std::numeric_limits<uint16_t>::max());
container_offsets.emplace_back(static_cast<uint16_t>(offset));
offset += container_size;
}

assert(offset <= std::numeric_limits<uint16_t>::max());
const auto data_offset = static_cast<uint16_t>(offset);

return EOF1Header{
Expand Down

0 comments on commit 91f9a88

Please sign in to comment.