|
|
@ -217,6 +217,8 @@ inline bytesConstRef VM::go(ExtVMFace& _ext, OnOpFunc const& _onOp, uint64_t _st |
|
|
|
require(7); |
|
|
|
runGas = (bigint)c_callGas + m_stack[m_stack.size() - 1]; |
|
|
|
newTempSize = std::max(memNeed(m_stack[m_stack.size() - 6], m_stack[m_stack.size() - 7]), memNeed(m_stack[m_stack.size() - 4], m_stack[m_stack.size() - 5])); |
|
|
|
if (_ext.depth == 1024) |
|
|
|
BOOST_THROW_EXCEPTION(OutOfGas()); |
|
|
|
break; |
|
|
|
|
|
|
|
case Instruction::CREATE: |
|
|
@ -226,6 +228,8 @@ inline bytesConstRef VM::go(ExtVMFace& _ext, OnOpFunc const& _onOp, uint64_t _st |
|
|
|
u256 inSize = m_stack[m_stack.size() - 3]; |
|
|
|
newTempSize = (bigint)inOff + inSize; |
|
|
|
runGas = c_createGas; |
|
|
|
if (_ext.depth == 1024) |
|
|
|
BOOST_THROW_EXCEPTION(OutOfGas()); |
|
|
|
break; |
|
|
|
} |
|
|
|
case Instruction::EXP: |
|
|
@ -566,6 +570,7 @@ inline bytesConstRef VM::go(ExtVMFace& _ext, OnOpFunc const& _onOp, uint64_t _st |
|
|
|
break; |
|
|
|
default: |
|
|
|
// this is unreachable, but if someone introduces a bug in the future, he may get here.
|
|
|
|
assert(false); |
|
|
|
BOOST_THROW_EXCEPTION(InvalidOpcode() << errinfo_comment("CALLDATACOPY, CODECOPY or EXTCODECOPY instruction requested.")); |
|
|
|
break; |
|
|
|
} |
|
|
@ -795,8 +800,6 @@ inline bytesConstRef VM::go(ExtVMFace& _ext, OnOpFunc const& _onOp, uint64_t _st |
|
|
|
|
|
|
|
if (_ext.balance(_ext.myAddress) >= endowment) |
|
|
|
{ |
|
|
|
if (_ext.depth == 1024) |
|
|
|
BOOST_THROW_EXCEPTION(OutOfGas()); |
|
|
|
_ext.subBalance(endowment); |
|
|
|
m_stack.push_back((u160)_ext.create(endowment, m_gas, bytesConstRef(m_temp.data() + initOff, initSize), _onOp)); |
|
|
|
} |
|
|
@ -825,8 +828,6 @@ inline bytesConstRef VM::go(ExtVMFace& _ext, OnOpFunc const& _onOp, uint64_t _st |
|
|
|
|
|
|
|
if (_ext.balance(_ext.myAddress) >= value) |
|
|
|
{ |
|
|
|
if (_ext.depth == 1024) |
|
|
|
BOOST_THROW_EXCEPTION(OutOfGas()); |
|
|
|
_ext.subBalance(value); |
|
|
|
m_stack.push_back(_ext.call(inst == Instruction::CALL ? receiveAddress : _ext.myAddress, value, bytesConstRef(m_temp.data() + inOff, inSize), gas, bytesRef(m_temp.data() + outOff, outSize), _onOp, {}, receiveAddress)); |
|
|
|
} |
|
|
|