diff --git a/libethereum/Executive.cpp b/libethereum/Executive.cpp index 95f1c38cb..f8c526ac7 100644 --- a/libethereum/Executive.cpp +++ b/libethereum/Executive.cpp @@ -173,7 +173,10 @@ bool Executive::go(OnOpFunc const& _onOp) { m_out = m_vm->go(*m_ext, _onOp); if (m_ext) + { m_endGas += min((m_t.gas() - m_endGas) / 2, m_ext->sub.refunds); + m_logs = m_ext->sub.logs; + } m_endGas = m_vm->gas(); } catch (StepsDone const&) diff --git a/libevm/VM.h b/libevm/VM.h index a35b3f005..91a769a04 100644 --- a/libevm/VM.h +++ b/libevm/VM.h @@ -206,7 +206,7 @@ template dev::bytesConstRef dev::eth::VM::go(Ext& _ext, OnOpFunc con { unsigned n = (unsigned)inst - (unsigned)Instruction::LOG0; require(n + 2); - newTempSize = memNeed(m_stack[m_stack.size() - 1 - n], m_stack[m_stack.size() - 2 - n]); + newTempSize = memNeed(m_stack[m_stack.size() - 1 ], m_stack[m_stack.size() - 2]); break; } diff --git a/libevmcore/Instruction.cpp b/libevmcore/Instruction.cpp index 5d94a22ca..9062fd8ed 100644 --- a/libevmcore/Instruction.cpp +++ b/libevmcore/Instruction.cpp @@ -282,11 +282,11 @@ static const std::map c_instructionInfo = { Instruction::SWAP14, { "SWAP14", 0, 15, 15, false } }, { Instruction::SWAP15, { "SWAP15", 0, 16, 16, false } }, { Instruction::SWAP16, { "SWAP16", 0, 17, 17, false } }, - { Instruction::LOG0, { "LOG0", 0, 1, 0, true } }, - { Instruction::LOG1, { "LOG1", 0, 2, 0, true } }, - { Instruction::LOG2, { "LOG2", 0, 3, 0, true } }, - { Instruction::LOG3, { "LOG3", 0, 4, 0, true } }, - { Instruction::LOG4, { "LOG4", 0, 5, 0, true } }, + { Instruction::LOG0, { "LOG0", 0, 2, 0, true } }, + { Instruction::LOG1, { "LOG1", 0, 3, 0, true } }, + { Instruction::LOG2, { "LOG2", 0, 4, 0, true } }, + { Instruction::LOG3, { "LOG3", 0, 5, 0, true } }, + { Instruction::LOG4, { "LOG4", 0, 6, 0, true } }, { Instruction::CREATE, { "CREATE", 0, 3, 1, true } }, { Instruction::CALL, { "CALL", 0, 7, 1, true } }, { Instruction::CALLCODE, { "CALLCODE", 0, 7, 1, true } },