diff --git a/Compiler.h b/Compiler.h index 8471fae2a..e83d1ed3a 100644 --- a/Compiler.h +++ b/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/CompilerStack.h b/CompilerStack.h index 358c8fb77..e7143b7bb 100644 --- a/CompilerStack.h +++ b/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/ExpressionCompiler.h b/ExpressionCompiler.h index 67b16aac0..c0ee4ab48 100644 --- a/ExpressionCompiler.h +++ b/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/GlobalContext.h b/GlobalContext.h index 50a21f702..c6e35f504 100644 --- a/GlobalContext.h +++ b/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/NameAndTypeResolver.h b/NameAndTypeResolver.h index 23ac5fe77..1032a87cf 100644 --- a/NameAndTypeResolver.h +++ b/NameAndTypeResolver.h @@ -69,7 +69,7 @@ private: /// not contain code. std::map m_scopes; - DeclarationContainer* m_currentScope; + DeclarationContainer* m_currentScope = nullptr; }; /**