diff options
-rwxr-xr-x[-rw-r--r--] | AST.h | 0 | ||||
-rw-r--r-- | CompilerContext.cpp | 4 | ||||
-rw-r--r-- | CompilerContext.h | 6 | ||||
-rw-r--r-- | CompilerStack.cpp | 2 | ||||
-rw-r--r-- | Types.h | 2 | ||||
-rwxr-xr-x[-rw-r--r--] | Utils.h | 6 |
6 files changed, 13 insertions, 7 deletions
diff --git a/CompilerContext.cpp b/CompilerContext.cpp index 18357bf0..5d10a5f9 100644 --- a/CompilerContext.cpp +++ b/CompilerContext.cpp @@ -53,8 +53,8 @@ void CompilerContext::addAndInitializeVariable(VariableDeclaration const& _decla { addVariable(_declaration); - unsigned const size = _declaration.getType()->getSizeOnStack(); - for (unsigned i = 0; i < size; ++i) + int const size = _declaration.getType()->getSizeOnStack(); + for (int i = 0; i < size; ++i) *this << u256(0); m_asm.adjustDeposit(-size); } diff --git a/CompilerContext.h b/CompilerContext.h index 795f447a..14672c95 100644 --- a/CompilerContext.h +++ b/CompilerContext.h @@ -51,10 +51,10 @@ public: void adjustStackOffset(int _adjustment) { m_asm.adjustDeposit(_adjustment); } - bool isMagicGlobal(Declaration const* _declaration) const { return m_magicGlobals.count(_declaration); } - bool isFunctionDefinition(Declaration const* _declaration) const { return m_functionEntryLabels.count(_declaration); } + bool isMagicGlobal(Declaration const* _declaration) const { return m_magicGlobals.count(_declaration) != 0; } + bool isFunctionDefinition(Declaration const* _declaration) const { return m_functionEntryLabels.count(_declaration) != 0; } bool isLocalVariable(Declaration const* _declaration) const; - bool isStateVariable(Declaration const* _declaration) const { return m_stateVariables.count(_declaration); } + bool isStateVariable(Declaration const* _declaration) const { return m_stateVariables.count(_declaration) != 0; } eth::AssemblyItem getFunctionEntryLabel(FunctionDefinition const& _function) const; /// Returns the distance of the given local variable from the top of the local variable stack. diff --git a/CompilerStack.cpp b/CompilerStack.cpp index 174f9cd2..904c77c5 100644 --- a/CompilerStack.cpp +++ b/CompilerStack.cpp @@ -39,7 +39,7 @@ namespace solidity bool CompilerStack::addSource(string const& _name, string const& _content) { - bool existed = m_sources.count(_name); + bool existed = m_sources.count(_name) != 0; reset(true); m_sources[_name].scanner = make_shared<Scanner>(CharStream(_content), _name); return existed; @@ -178,7 +178,7 @@ public: int getNumBits() const { return m_bits; } bool isHash() const { return m_modifier == Modifier::HASH || m_modifier == Modifier::ADDRESS; } bool isAddress() const { return m_modifier == Modifier::ADDRESS; } - int isSigned() const { return m_modifier == Modifier::SIGNED; } + bool isSigned() const { return m_modifier == Modifier::SIGNED; } static const MemberList AddressMemberList; @@ -45,5 +45,11 @@ inline void solAssertAux(bool _condition, std::string const& _errorDescription, << ::boost::throw_line(_line)); } +inline void solAssertAux(void const* _pointer, std::string const& _errorDescription, unsigned _line, + char const* _file, char const* _function) +{ + solAssertAux(_pointer != nullptr, _errorDescription, _line, _file, _function); +} + } } |