From 6cc8c9de6953db631f67888f5a5c0abdee307975 Mon Sep 17 00:00:00 2001 From: Gav Wood Date: Wed, 7 Jan 2015 20:23:33 +0100 Subject: [PATCH] VM skips push data when looking for JUMPDEST. Warnings fixes. --- libevm/VM.h | 3 ++- libsolidity/Types.h | 6 ++++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/libevm/VM.h b/libevm/VM.h index cc9556c26..b8a33909c 100644 --- a/libevm/VM.h +++ b/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) diff --git a/libsolidity/Types.h b/libsolidity/Types.h index 6f3ca6abf..a91a6c24e 100644 --- a/libsolidity/Types.h +++ b/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(); }