Browse Source

Fix for overuse of stack.

cl-refactor
Gav Wood 10 years ago
parent
commit
a6cd367483
  1. 3
      libethereum/State.cpp
  2. 2
      libevm/ExtVMFace.h

3
libethereum/State.cpp

@ -996,11 +996,12 @@ bool State::isTrieGood(bool _enforceRefs, bool _requireNoLeftOvers) const
LastHashes State::getLastHashes(BlockChain const& _bc) const LastHashes State::getLastHashes(BlockChain const& _bc) const
{ {
LastHashes ret; LastHashes ret;
ret.resize(256);
if (c_protocolVersion > 49) if (c_protocolVersion > 49)
{ {
unsigned n = (unsigned)m_previousBlock.number; unsigned n = (unsigned)m_previousBlock.number;
for (unsigned i = 0; i < 256; ++i) for (unsigned i = 0; i < 256; ++i)
ret[i] = _bc.numberHash(n - i); ret[i] = _bc.numberHash(std::max<unsigned>(n, i) - i);
} }
return ret; return ret;
} }

2
libevm/ExtVMFace.h

@ -93,7 +93,7 @@ struct SubState
class ExtVMFace; class ExtVMFace;
class VM; class VM;
using LastHashes = std::array<h256, 256>; using LastHashes = std::vector<h256>;
using OnOpFunc = std::function<void(uint64_t /*steps*/, Instruction /*instr*/, bigint /*newMemSize*/, bigint /*gasCost*/, VM*, ExtVMFace const*)>; using OnOpFunc = std::function<void(uint64_t /*steps*/, Instruction /*instr*/, bigint /*newMemSize*/, bigint /*gasCost*/, VM*, ExtVMFace const*)>;

Loading…
Cancel
Save