From 67ed69d59b9e7f49f528975e035a7f2a6d9d9185 Mon Sep 17 00:00:00 2001 From: Gav Wood Date: Tue, 28 Oct 2014 13:43:33 +0100 Subject: [PATCH 1/3] PoC-7: Latest SIGNEXTEND. --- libevm/VM.h | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/libevm/VM.h b/libevm/VM.h index e81ddb475..774667902 100644 --- a/libevm/VM.h +++ b/libevm/VM.h @@ -449,18 +449,13 @@ template dev::bytesConstRef dev::eth::VM::go(Ext& _ext, OnOpFunc con break; case Instruction::SIGNEXTEND: { - unsigned k = m_stack[m_stack.size() - 2]; - if (k > 31) - m_stack[m_stack.size() - 2] = m_stack.back(); - else - { - u256 b = m_stack.back(); + unsigned k = m_stack.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); - m_stack[m_stack.size() - 2] = b; - } - m_stack.pop_back(); break; } case Instruction::SHA3: From 7b681b091365b138a4a9665dd4dc28c6c34ee56f Mon Sep 17 00:00:00 2001 From: Marek Kotewicz Date: Tue, 28 Oct 2014 15:05:38 +0100 Subject: [PATCH 2/3] fix for compiling under llvm --- libdevcore/FixedHash.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libdevcore/FixedHash.h b/libdevcore/FixedHash.h index 284745c64..41d140cad 100644 --- a/libdevcore/FixedHash.h +++ b/libdevcore/FixedHash.h @@ -158,7 +158,7 @@ public: return ret; } - template inline FixedHash& shiftBloom(FixedHash const& _h) { return (*this |= _h.nbloom()); } + template inline FixedHash& shiftBloom(FixedHash const& _h) { return (*this |= _h.template nbloom()); } template inline FixedHash nbloom() const { From e17e240b5dfc033e14c8e91122ef5522c293e28c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pawe=C5=82=20Bylica?= Date: Tue, 28 Oct 2014 16:26:33 +0100 Subject: [PATCH 3/3] Fix VM test code loading conditions --- test/vm.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/vm.cpp b/test/vm.cpp index 40a0a862b..d69f03fda 100644 --- a/test/vm.cpp +++ b/test/vm.cpp @@ -359,9 +359,9 @@ void FakeExtVM::importExec(mObject& _o) code = &thisTxCode; if (_o["code"].type() == str_type) 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)); + else + thisTxCode = compileLLL(_o["code"].get_str()); else if (_o["code"].type() == array_type) for (auto const& j: _o["code"].get_array()) thisTxCode.push_back(toByte(j));