diff --git a/libethereum/Common.h b/libethereum/Common.h index 68f19928b..ca5bd6ffa 100644 --- a/libethereum/Common.h +++ b/libethereum/Common.h @@ -24,7 +24,7 @@ #pragma once // define version -#define ETH_VERSION 0.4.2 +#define ETH_VERSION 0.5.0 // way to many uint to size_t warnings in 32 bit build #ifdef _M_IX86 diff --git a/libethereum/VM.h b/libethereum/VM.h index 6a8984bfe..99b0a4740 100644 --- a/libethereum/VM.h +++ b/libethereum/VM.h @@ -206,30 +206,22 @@ template eth::bytesConstRef eth::VM::go(Ext& _ext, uint64_t _steps) break; case Instruction::DIV: require(2); - if (!m_stack[m_stack.size() - 2]) - return bytesConstRef(); - m_stack[m_stack.size() - 2] = m_stack.back() / m_stack[m_stack.size() - 2]; + m_stack[m_stack.size() - 2] = m_stack[m_stack.size() - 2] ? m_stack.back() / m_stack[m_stack.size() - 2] : 0; m_stack.pop_back(); break; case Instruction::SDIV: require(2); - if (!m_stack[m_stack.size() - 2]) - return bytesConstRef(); - (s256&)m_stack[m_stack.size() - 2] = (s256&)m_stack.back() / (s256&)m_stack[m_stack.size() - 2]; + (s256&)m_stack[m_stack.size() - 2] = m_stack[m_stack.size() - 2] ? (s256&)m_stack.back() / (s256&)m_stack[m_stack.size() - 2] : 0; m_stack.pop_back(); break; case Instruction::MOD: require(2); - if (!m_stack[m_stack.size() - 2]) - return bytesConstRef(); - m_stack[m_stack.size() - 2] = m_stack.back() % m_stack[m_stack.size() - 2]; + m_stack[m_stack.size() - 2] = m_stack[m_stack.size() - 2] ? m_stack.back() % m_stack[m_stack.size() - 2] : 0; m_stack.pop_back(); break; case Instruction::SMOD: require(2); - if (!m_stack[m_stack.size() - 2]) - return bytesConstRef(); - (s256&)m_stack[m_stack.size() - 2] = (s256&)m_stack.back() % (s256&)m_stack[m_stack.size() - 2]; + (s256&)m_stack[m_stack.size() - 2] = m_stack[m_stack.size() - 2] ? (s256&)m_stack.back() % (s256&)m_stack[m_stack.size() - 2] : 0; m_stack.pop_back(); break; case Instruction::EXP: