diff --git a/libevm/VM.h b/libevm/VM.h index d5db792f5..6e9819ccd 100644 --- a/libevm/VM.h +++ b/libevm/VM.h @@ -427,12 +427,12 @@ template dev::bytesConstRef dev::eth::VM::go(Ext& _ext, OnOpFunc con break; case Instruction::SIGNEXTEND: { - unsigned k = m_stack.back(); + unsigned k = m_stack.back().convert_to(); m_stack.pop_back(); auto& b = m_stack.back(); if (k <= 31) if ((b >> (k * 8)) & 0x80) - for (int i = 31; i > k; --i) + for (unsigned i = 31; i > k; --i) b |= (u256(0xff) << i); break; }