Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions src/runtime/evm_instance.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
#include "runtime/evm_module.h"
#include "runtime/instance.h"
#include <array>
#include <deque>
#include <limits>
#include <memory>

Expand Down Expand Up @@ -141,8 +142,8 @@ class EVMInstance final : public RuntimeObject<EVMInstance> {
std::unordered_map<std::pair<const evmc_message *, uint64_t>, evmc::bytes32,
PairHash>
CalldataLoads;
std::vector<evmc::bytes32> ExtcodeHashes;
std::vector<evmc::bytes32> Keccak256Results;
std::deque<evmc::bytes32> ExtcodeHashes;
std::deque<evmc::bytes32> Keccak256Results;
Comment on lines +145 to +146
Copy link

Copilot AI Feb 28, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This fix addresses a subtle JIT use-after-free scenario, but the PR doesn’t add a regression test to ensure pointer stability across multiple runtime calls (e.g., two EXTCODEHASH / KECCAK256 result pointers kept alive and consumed later in multipass JIT mode). Given the repo already has extensive GoogleTest-based EVM tests, please add a targeted test that fails with the previous std::vector implementation and passes with std::deque to prevent regressions.

Copilot uses AI. Check for mistakes.
bool TxContextCached = false;
};

Expand Down