Browse Source

VM skips push data when looking for JUMPDEST.

Warnings fixes.
cl-refactor
Gav Wood 10 years ago
parent
commit
6cc8c9de69
  1. 3
      libevm/VM.h
  2. 6
      libsolidity/Types.h

3
libevm/VM.h

@ -86,7 +86,8 @@ inline bytesConstRef VM::go(ExtVMFace& _ext, OnOpFunc const& _onOp, uint64_t _st
for (unsigned i = 0; i < _ext.code.size(); ++i)
if (_ext.code[i] == (byte)Instruction::JUMPDEST)
m_jumpDests.insert(i);
else if (_ext.code[i] >= (byte)Instruction::PUSH1 && _ext.code[i] <= (byte)Instruction::PUSH32)
i += _ext.code[i] - (unsigned)Instruction::PUSH1 + 1;
u256 nextPC = m_curPC + 1;
auto osteps = _steps;
for (bool stopped = false; !stopped && _steps--; m_curPC = nextPC, nextPC = m_curPC + 1)

6
libsolidity/Types.h

@ -415,6 +415,9 @@ public:
protected:
virtual TypePointer binaryOperatorResultImpl(Token::Value _operator, TypePointer const& _this, TypePointer const& _other) const override
{
(void)_operator;
(void)_this;
(void)_other;
return TypePointer();
}
@ -445,6 +448,9 @@ public:
protected:
virtual TypePointer binaryOperatorResultImpl(Token::Value _operator, TypePointer const& _this, TypePointer const& _other) const override
{
(void)_operator;
(void)_this;
(void)_other;
return TypePointer();
}

Loading…
Cancel
Save