Skip to content

Commit

Permalink
baseline: disable jumpdest analysis
Browse files Browse the repository at this point in the history
  • Loading branch information
chfast committed Jun 6, 2024
1 parent a66479f commit 47ec33c
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
4 changes: 2 additions & 2 deletions lib/evmone/baseline.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ namespace evmone::baseline
{
namespace
{
CodeAnalysis::JumpdestMap analyze_jumpdests(bytes_view code)
[[maybe_unused]] CodeAnalysis::JumpdestMap analyze_jumpdests(bytes_view code)

Check warning on line 29 in lib/evmone/baseline.cpp

View check run for this annotation

Codecov / codecov/patch

lib/evmone/baseline.cpp#L29

Added line #L29 was not covered by tests
{
// To find if op is any PUSH opcode (OP_PUSH1 <= op <= OP_PUSH32)
// it can be noticed that OP_PUSH32 is INT8_MAX (0x7f) therefore
Expand Down Expand Up @@ -63,7 +63,7 @@ std::unique_ptr<uint8_t[]> pad_code(bytes_view code)
CodeAnalysis analyze_legacy(bytes_view code)
{
// TODO: The padded code buffer and jumpdest bitmap can be created with single allocation.
return {pad_code(code), code.size(), analyze_jumpdests(code)};
return {pad_code(code), code.size(), {}};
}

CodeAnalysis analyze_eof1(bytes_view container)
Expand Down
12 changes: 6 additions & 6 deletions lib/evmone/instructions.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -747,12 +747,12 @@ Result sstore(StackTop stack, int64_t gas_left, ExecutionState& state) noexcept;
/// Internal jump implementation for JUMP/JUMPI instructions.
inline code_iterator jump_impl(ExecutionState& state, const uint256& dst) noexcept
{
const auto& jumpdest_map = state.analysis.baseline->jumpdest_map;
if (dst >= jumpdest_map.size() || !jumpdest_map[static_cast<size_t>(dst)])
{
state.status = EVMC_BAD_JUMP_DESTINATION;
return nullptr;
}
// const auto& jumpdest_map = state.analysis.baseline->jumpdest_map;
// if (dst >= jumpdest_map.size() || !jumpdest_map[static_cast<size_t>(dst)])
// {
// state.status = EVMC_BAD_JUMP_DESTINATION;
// return nullptr;
// }

return &state.analysis.baseline->executable_code[static_cast<size_t>(dst)];
}
Expand Down

0 comments on commit 47ec33c

Please sign in to comment.