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 537d394
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/evmone/eof.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -773,7 +773,6 @@ std::variant<EOF1Header, EOFValidationError> validate_header(

for (const auto code_size : code_sizes)
{
assert(offset <= std::numeric_limits<uint16_t>::max());
code_offsets.emplace_back(static_cast<uint16_t>(offset));
offset += code_size;
}
Expand All @@ -785,6 +784,8 @@ std::variant<EOF1Header, EOFValidationError> validate_header(
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 537d394

Please sign in to comment.