From 537d394af33f171e7bb1fabd41d963fb7fc025a8 Mon Sep 17 00:00:00 2001 From: pdobacz <5735525+pdobacz@users.noreply.github.com> Date: Wed, 26 Jun 2024 14:47:39 +0200 Subject: [PATCH] Tidy assertions in `validate_header` --- lib/evmone/eof.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/evmone/eof.cpp b/lib/evmone/eof.cpp index a5e2f343cd..ef090329ea 100644 --- a/lib/evmone/eof.cpp +++ b/lib/evmone/eof.cpp @@ -773,7 +773,6 @@ std::variant validate_header( for (const auto code_size : code_sizes) { - assert(offset <= std::numeric_limits::max()); code_offsets.emplace_back(static_cast(offset)); offset += code_size; } @@ -785,6 +784,8 @@ std::variant validate_header( container_offsets.emplace_back(static_cast(offset)); offset += container_size; } + + assert(offset <= std::numeric_limits::max()); const auto data_offset = static_cast(offset); return EOF1Header{