Skip to content
This repository has been archived by the owner on Oct 28, 2021. It is now read-only.

Commit

Permalink
evm: Restore previous code for tracing
Browse files Browse the repository at this point in the history
  • Loading branch information
chfast committed Nov 20, 2018
1 parent 3fd6762 commit 9952ab6
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions libevm/EVMC.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ owning_bytes_ref EVMC::exec(u256& io_gas, ExtVMFace& _ext, const OnOpFunc& _onOp
assert(_ext.envInfo().gasLimit() <= int64max);
assert(_ext.depth <= static_cast<size_t>(std::numeric_limits<int32_t>::max()));

auto prevCode = m_code;
m_code = bytesConstRef{&_ext.code};

auto gas = static_cast<int64_t>(io_gas);
Expand All @@ -105,6 +106,8 @@ owning_bytes_ref EVMC::exec(u256& io_gas, ExtVMFace& _ext, const OnOpFunc& _onOp
m_prevCall = m_currentCall;
m_currentCall = parentCall;

m_code = prevCode;

if (_ext.depth == 0)
dumpTrace();

Expand Down

0 comments on commit 9952ab6

Please sign in to comment.