Browse Source

Latest VM spec.

cl-refactor
Gav Wood 11 years ago
parent
commit
1ce0e90df1
  1. 2
      libethereum/Common.h
  2. 16
      libethereum/VM.h

2
libethereum/Common.h

@ -24,7 +24,7 @@
#pragma once #pragma once
// define version // 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 // way to many uint to size_t warnings in 32 bit build
#ifdef _M_IX86 #ifdef _M_IX86

16
libethereum/VM.h

@ -206,30 +206,22 @@ template <class Ext> eth::bytesConstRef eth::VM::go(Ext& _ext, uint64_t _steps)
break; break;
case Instruction::DIV: case Instruction::DIV:
require(2); require(2);
if (!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;
return bytesConstRef();
m_stack[m_stack.size() - 2] = m_stack.back() / m_stack[m_stack.size() - 2];
m_stack.pop_back(); m_stack.pop_back();
break; break;
case Instruction::SDIV: case Instruction::SDIV:
require(2); require(2);
if (!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;
return bytesConstRef();
(s256&)m_stack[m_stack.size() - 2] = (s256&)m_stack.back() / (s256&)m_stack[m_stack.size() - 2];
m_stack.pop_back(); m_stack.pop_back();
break; break;
case Instruction::MOD: case Instruction::MOD:
require(2); require(2);
if (!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;
return bytesConstRef();
m_stack[m_stack.size() - 2] = m_stack.back() % m_stack[m_stack.size() - 2];
m_stack.pop_back(); m_stack.pop_back();
break; break;
case Instruction::SMOD: case Instruction::SMOD:
require(2); require(2);
if (!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;
return bytesConstRef();
(s256&)m_stack[m_stack.size() - 2] = (s256&)m_stack.back() % (s256&)m_stack[m_stack.size() - 2];
m_stack.pop_back(); m_stack.pop_back();
break; break;
case Instruction::EXP: case Instruction::EXP:

Loading…
Cancel
Save