From 460571bd7732d6829327c51c18c82cd705931345 Mon Sep 17 00:00:00 2001 From: Christian Date: Wed, 7 Jan 2015 16:46:15 +0100 Subject: [PATCH 1/4] Fix some warnings about uninitialized members. --- libsolidity/Compiler.h | 2 +- libsolidity/CompilerStack.h | 2 +- libsolidity/ExpressionCompiler.h | 6 +++--- libsolidity/GlobalContext.h | 2 +- libsolidity/NameAndTypeResolver.h | 2 +- 5 files changed, 7 insertions(+), 7 deletions(-) diff --git a/libsolidity/Compiler.h b/libsolidity/Compiler.h index 8471fae2a..e83d1ed3a 100644 --- a/libsolidity/Compiler.h +++ b/libsolidity/Compiler.h @@ -30,7 +30,7 @@ namespace solidity { class Compiler: private ASTConstVisitor { public: - explicit Compiler(bool _optimize = false): m_optimize(_optimize), m_returnTag(m_context.newTag()) {} + explicit Compiler(bool _optimize = false): m_optimize(_optimize), m_context(), m_returnTag(m_context.newTag()) {} void compileContract(ContractDefinition const& _contract, std::vector const& _magicGlobals, std::map const& _contracts); diff --git a/libsolidity/CompilerStack.h b/libsolidity/CompilerStack.h index 358c8fb77..e7143b7bb 100644 --- a/libsolidity/CompilerStack.h +++ b/libsolidity/CompilerStack.h @@ -113,7 +113,7 @@ private: struct Contract { - ContractDefinition const* contract; + ContractDefinition const* contract = nullptr; std::shared_ptr compiler; bytes bytecode; std::shared_ptr interfaceHandler; diff --git a/libsolidity/ExpressionCompiler.h b/libsolidity/ExpressionCompiler.h index 67b16aac0..c0ee4ab48 100644 --- a/libsolidity/ExpressionCompiler.h +++ b/libsolidity/ExpressionCompiler.h @@ -146,12 +146,12 @@ private: private: CompilerContext* m_context; - LValueType m_type; + LValueType m_type = NONE; /// If m_type is STACK, this is base stack offset (@see /// CompilerContext::getBaseStackOffsetOfVariable) of a local variable. - unsigned m_baseStackOffset; + unsigned m_baseStackOffset = 0; /// Size of the value of this lvalue on the stack. - unsigned m_stackSize; + unsigned m_stackSize = 0; }; bool m_optimize; diff --git a/libsolidity/GlobalContext.h b/libsolidity/GlobalContext.h index 50a21f702..c6e35f504 100644 --- a/libsolidity/GlobalContext.h +++ b/libsolidity/GlobalContext.h @@ -56,7 +56,7 @@ public: private: std::vector> m_magicVariables; - ContractDefinition const* m_currentContract; + ContractDefinition const* m_currentContract = nullptr; std::map> mutable m_thisPointer; }; diff --git a/libsolidity/NameAndTypeResolver.h b/libsolidity/NameAndTypeResolver.h index 23ac5fe77..1032a87cf 100644 --- a/libsolidity/NameAndTypeResolver.h +++ b/libsolidity/NameAndTypeResolver.h @@ -69,7 +69,7 @@ private: /// not contain code. std::map m_scopes; - DeclarationContainer* m_currentScope; + DeclarationContainer* m_currentScope = nullptr; }; /** From bf8174ecee66f024bf46ef249dd70967aaeee9d9 Mon Sep 17 00:00:00 2001 From: Gav Wood Date: Wed, 7 Jan 2015 16:58:09 +0100 Subject: [PATCH 2/4] Warnings fixes. Make Mix work with Qt 5.2 Minor other alterations. --- libevmcore/Assembly.cpp | 6 +++--- libsolidity/Types.h | 3 +++ mix/AssemblyDebuggerModel.cpp | 1 - mix/qml/StateDialog.qml | 2 +- mix/qml/StateList.qml | 6 +++--- mix/qml/TransactionDialog.qml | 2 +- mix/qml/main.qml | 4 ++-- 7 files changed, 13 insertions(+), 11 deletions(-) diff --git a/libevmcore/Assembly.cpp b/libevmcore/Assembly.cpp index fd256d688..f7a71102f 100644 --- a/libevmcore/Assembly.cpp +++ b/libevmcore/Assembly.cpp @@ -391,9 +391,9 @@ Assembly& Assembly::optimise(bool _enable) if (matches(vr, &r.first)) { auto rw = r.second(vr); - unsigned const vrSize = bytesRequiredBySlice(vr.begin(), vr.end()); - unsigned const rwSize = bytesRequiredBySlice(rw.begin(), rw.end()); - if (rwSize < vrSize || (rwSize == vrSize && popCountIncreased(vr, rw))) + unsigned const vrSizeInBytes = bytesRequiredBySlice(vr.begin(), vr.end()); + unsigned const rwSizeInBytes = bytesRequiredBySlice(rw.begin(), rw.end()); + if (rwSizeInBytes < vrSizeInBytes || (rwSizeInBytes == vrSizeInBytes && popCountIncreased(vr, rw))) { copt << vr << "matches" << AssemblyItemsConstRef(&r.first) << "becomes..."; copt << AssemblyItemsConstRef(&rw); diff --git a/libsolidity/Types.h b/libsolidity/Types.h index ff8a48877..6f3ca6abf 100644 --- a/libsolidity/Types.h +++ b/libsolidity/Types.h @@ -387,6 +387,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(); } }; diff --git a/mix/AssemblyDebuggerModel.cpp b/mix/AssemblyDebuggerModel.cpp index d09c2cd18..e822d0a3f 100644 --- a/mix/AssemblyDebuggerModel.cpp +++ b/mix/AssemblyDebuggerModel.cpp @@ -74,7 +74,6 @@ DebuggingContent AssemblyDebuggerModel::executeTransaction(bytesConstRef const& execution.go(onOp); execution.finalize(); - m_executiveState.completeMine(); DebuggingContent d; d.returnValue = execution.out().toVector(); diff --git a/mix/qml/StateDialog.qml b/mix/qml/StateDialog.qml index eb0b68ac8..862e6f854 100644 --- a/mix/qml/StateDialog.qml +++ b/mix/qml/StateDialog.qml @@ -1,5 +1,5 @@ import QtQuick 2.2 -import QtQuick.Controls 1.2 +import QtQuick.Controls 1.1 import QtQuick.Layouts 1.1 import QtQuick.Window 2.0 diff --git a/mix/qml/StateList.qml b/mix/qml/StateList.qml index 152a35671..0d4b6e5c6 100644 --- a/mix/qml/StateList.qml +++ b/mix/qml/StateList.qml @@ -1,7 +1,7 @@ import QtQuick 2.2 -import QtQuick.Controls.Styles 1.2 -import QtQuick.Controls 1.2 -import QtQuick.Dialogs 1.2 +import QtQuick.Controls.Styles 1.1 +import QtQuick.Controls 1.1 +import QtQuick.Dialogs 1.1 import QtQuick.Layouts 1.1 Rectangle { diff --git a/mix/qml/TransactionDialog.qml b/mix/qml/TransactionDialog.qml index b7c556272..54528f97f 100644 --- a/mix/qml/TransactionDialog.qml +++ b/mix/qml/TransactionDialog.qml @@ -1,5 +1,5 @@ import QtQuick 2.2 -import QtQuick.Controls 1.2 +import QtQuick.Controls 1.1 import QtQuick.Layouts 1.1 import QtQuick.Window 2.0 diff --git a/mix/qml/main.qml b/mix/qml/main.qml index bba7c9088..6e946cdfd 100644 --- a/mix/qml/main.qml +++ b/mix/qml/main.qml @@ -1,6 +1,6 @@ import QtQuick 2.2 -import QtQuick.Controls 1.2 -import QtQuick.Controls.Styles 1.2 +import QtQuick.Controls 1.1 +import QtQuick.Controls.Styles 1.1 import QtQuick.Dialogs 1.1 import QtQuick.Layouts 1.1 import QtQuick.Window 2.1 From e9913a3d10136ce46090bdd94b0d0a4c870f69d8 Mon Sep 17 00:00:00 2001 From: Marek Kotewicz Date: Tue, 6 Jan 2015 19:17:05 +0100 Subject: [PATCH 3/4] new vps for windows build --- extdep/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/extdep/CMakeLists.txt b/extdep/CMakeLists.txt index 19cd00f7b..fdee34602 100644 --- a/extdep/CMakeLists.txt +++ b/extdep/CMakeLists.txt @@ -7,7 +7,7 @@ include(eth_download.cmake) # all dependencies will be installed into this directory, separated by platform string(TOLOWER ${CMAKE_SYSTEM_NAME} _system_name) set(ETH_DEPENDENCY_INSTALL_DIR "${CMAKE_CURRENT_SOURCE_DIR}/install/${_system_name}") -set(ETH_DEPENDENCY_SERVER "http://poc-7.ethdev.com/precompiled/${_system_name}") +set(ETH_DEPENDENCY_SERVER "http://build.ethdev.com/builds/${_system_name}-precompiled") file(MAKE_DIRECTORY ${ETH_DEPENDENCY_INSTALL_DIR}/lib) file(MAKE_DIRECTORY ${ETH_DEPENDENCY_INSTALL_DIR}/include) file(MAKE_DIRECTORY ${ETH_DEPENDENCY_INSTALL_DIR}/bin) From 6cc8c9de6953db631f67888f5a5c0abdee307975 Mon Sep 17 00:00:00 2001 From: Gav Wood Date: Wed, 7 Jan 2015 20:23:33 +0100 Subject: [PATCH 4/4] 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(); }