From b840730b4fb4ef87395a3f3c4fac17218e72d707 Mon Sep 17 00:00:00 2001 From: Christoph Jentzsch Date: Fri, 14 Nov 2014 07:55:10 +0100 Subject: [PATCH] explicit type cast --- libevm/VM.h | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/libevm/VM.h b/libevm/VM.h index 5c153a6ea..52149a9a1 100644 --- a/libevm/VM.h +++ b/libevm/VM.h @@ -206,9 +206,7 @@ template dev::bytesConstRef dev::eth::VM::go(Ext& _ext, OnOpFunc con { unsigned n = (unsigned)inst - (unsigned)Instruction::LOG0; require(n + 2); - runGas = m_stack[m_stack.size() - 2]; - runGas *= c_logDataGas; - runGas += c_logGas + c_logTopicGas * n; + runGas = c_logGas + c_logTopicGas * n + (bigint)c_logDataGas * m_stack[m_stack.size() - 2]; newTempSize = memNeed(m_stack[m_stack.size() - 1], m_stack[m_stack.size() - 2]); break; } @@ -216,8 +214,7 @@ template dev::bytesConstRef dev::eth::VM::go(Ext& _ext, OnOpFunc con case Instruction::CALL: case Instruction::CALLCODE: require(7); - runGas = m_stack[m_stack.size() - 1]; - runGas += c_callGas; + 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])); break;