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

interpreter: Fix call depth handling in CALLs #5662

Merged
merged 2 commits into from
Jul 10, 2019
Merged
Show file tree
Hide file tree
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
1 change: 1 addition & 0 deletions libaleth-interpreter/VMCalls.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -258,6 +258,7 @@ bool VM::caseCallSetup(evmc_message& o_msg, bytesRef& o_output)
m_runGas = o_msg.gas;
updateIOGas();

o_msg.depth = m_message->depth + 1;
o_msg.destination = destination;
o_msg.sender = m_message->destination;
o_msg.input_data = m_mem.data() + size_t(inputOffset);
Expand Down
1 change: 1 addition & 0 deletions libevm/ExtVMFace.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -202,6 +202,7 @@ evmc::result EvmCHost::create(evmc_message const& _msg) noexcept
evmc::result EvmCHost::call(evmc_message const& _msg) noexcept
{
assert(_msg.gas >= 0 && "Invalid gas value");
assert(_msg.depth == static_cast<int>(m_extVM.depth) + 1);

// Handle CREATE separately.
if (_msg.kind == EVMC_CREATE || _msg.kind == EVMC_CREATE2)
Expand Down