Browse Source

Merge branch 'develop' into develop-evmcc

Conflicts:
	libevm/VM.h
cl-refactor
Paweł Bylica 10 years ago
parent
commit
ae68c1c5d5
  1. 2
      libdevcore/FixedHash.h
  2. 8
      libevm/VM.h
  3. 4
      test/vm.cpp

2
libdevcore/FixedHash.h

@ -158,7 +158,7 @@ public:
return ret; return ret;
} }
template <unsigned P, unsigned M> inline FixedHash& shiftBloom(FixedHash<M> const& _h) { return (*this |= _h.nbloom<P, N>()); } template <unsigned P, unsigned M> inline FixedHash& shiftBloom(FixedHash<M> const& _h) { return (*this |= _h.template nbloom<P, N>()); }
template <unsigned P, unsigned M> inline FixedHash<M> nbloom() const template <unsigned P, unsigned M> inline FixedHash<M> nbloom() const
{ {

8
libevm/VM.h

@ -427,9 +427,13 @@ template <class Ext> dev::bytesConstRef dev::eth::VM::go(Ext& _ext, OnOpFunc con
break; break;
case Instruction::SIGNEXTEND: case Instruction::SIGNEXTEND:
{ {
auto k = m_stack[m_stack.size() - 2]; unsigned k = m_stack.back();
m_stack[m_stack.size() - 2] = m_stack.back();
m_stack.pop_back(); m_stack.pop_back();
auto& b = m_stack.back();
if (k <= 31)
if ((b >> (k * 8)) & 0x80)
for (int i = 31; i > k; --i)
b |= (u256(0xff) << i);
break; break;
} }
case Instruction::SHA3: case Instruction::SHA3:

4
test/vm.cpp

@ -359,9 +359,9 @@ void FakeExtVM::importExec(mObject& _o)
code = &thisTxCode; code = &thisTxCode;
if (_o["code"].type() == str_type) if (_o["code"].type() == str_type)
if (_o["code"].get_str().find_first_of("0x") == 0) if (_o["code"].get_str().find_first_of("0x") == 0)
thisTxCode = compileLLL(_o["code"].get_str());
else
thisTxCode = fromHex(_o["code"].get_str().substr(2)); thisTxCode = fromHex(_o["code"].get_str().substr(2));
else
thisTxCode = compileLLL(_o["code"].get_str());
else if (_o["code"].type() == array_type) else if (_o["code"].type() == array_type)
for (auto const& j: _o["code"].get_array()) for (auto const& j: _o["code"].get_array())
thisTxCode.push_back(toByte(j)); thisTxCode.push_back(toByte(j));

Loading…
Cancel
Save