Skip to content

Commit

Permalink
Fix conversion warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
chfast committed Mar 16, 2023
1 parent 1b39d8d commit 47a6b75
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions lib/evmone/eof.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -371,8 +371,8 @@ std::pair<EOFValidationError, int32_t> validate_max_stack_height(
if (opcode == OP_RJUMP || opcode == OP_RJUMPI)
{
const auto target_rel_offset = read_int16_be(&code[i + 1]);
validate_successor(
static_cast<size_t>(static_cast<int32_t>(i) + target_rel_offset + 3), stack_height);
const auto target = static_cast<int32_t>(i) + target_rel_offset + 3;
validate_successor(static_cast<size_t>(target), stack_height);
}
else if (opcode == OP_RJUMPV)
{
Expand All @@ -382,9 +382,8 @@ std::pair<EOFValidationError, int32_t> validate_max_stack_height(
for (size_t k = 0; k < count; ++k)
{
const auto target_rel_offset = read_int16_be(&code[i + k * 2 + 2]);
validate_successor(
static_cast<size_t>(static_cast<int32_t>(next) + target_rel_offset),
stack_height);
const auto target = static_cast<int32_t>(next) + target_rel_offset;
validate_successor(static_cast<size_t>(target), stack_height);
}
}

Expand Down

0 comments on commit 47a6b75

Please sign in to comment.