diff options
author | chriseth <chris@ethereum.org> | 2017-08-22 21:39:50 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-08-22 21:39:50 +0800 |
commit | 210b4870a805620329793c8ba2177a3ff6e7b477 (patch) | |
tree | 65b5afa20b8a2ba5466bb681b5216cc655fd74d6 /libsolidity | |
parent | badb269502643c779ead6e53978175a2e8f43594 (diff) | |
parent | f2d6226718a226ae4764bd7d1379c6e50c7f269a (diff) | |
download | dexon-solidity-210b4870a805620329793c8ba2177a3ff6e7b477.tar.gz dexon-solidity-210b4870a805620329793c8ba2177a3ff6e7b477.tar.zst dexon-solidity-210b4870a805620329793c8ba2177a3ff6e7b477.zip |
Merge pull request #2775 from ethereum/coverity
Fix some issues found by Coverity
Diffstat (limited to 'libsolidity')
-rw-r--r-- | libsolidity/ast/AST.cpp | 1 | ||||
-rw-r--r-- | libsolidity/ast/Types.cpp | 8 |
2 files changed, 4 insertions, 5 deletions
diff --git a/libsolidity/ast/AST.cpp b/libsolidity/ast/AST.cpp index e173237e..605daf55 100644 --- a/libsolidity/ast/AST.cpp +++ b/libsolidity/ast/AST.cpp @@ -188,7 +188,6 @@ vector<pair<FixedHash<4>, FunctionTypePointer>> const& ContractDefinition::inter { if (!m_interfaceFunctionList) { - set<string> functionsSeen; set<string> signaturesSeen; m_interfaceFunctionList.reset(new vector<pair<FixedHash<4>, FunctionTypePointer>>()); for (ContractDefinition const* contract: annotation().linearizedBaseContracts) diff --git a/libsolidity/ast/Types.cpp b/libsolidity/ast/Types.cpp index adf41229..5e61cdee 100644 --- a/libsolidity/ast/Types.cpp +++ b/libsolidity/ast/Types.cpp @@ -739,18 +739,18 @@ bool RationalNumberType::isImplicitlyConvertibleTo(Type const& _convertTo) const { if (_convertTo.category() == Category::Integer) { - auto targetType = dynamic_cast<IntegerType const*>(&_convertTo); if (m_value == rational(0)) return true; if (isFractional()) return false; - int forSignBit = (targetType->isSigned() ? 1 : 0); + IntegerType const& targetType = dynamic_cast<IntegerType const&>(_convertTo); + int forSignBit = (targetType.isSigned() ? 1 : 0); if (m_value > rational(0)) { - if (m_value.numerator() <= (u256(-1) >> (256 - targetType->numBits() + forSignBit))) + if (m_value.numerator() <= (u256(-1) >> (256 - targetType.numBits() + forSignBit))) return true; } - else if (targetType->isSigned() && -m_value.numerator() <= (u256(1) << (targetType->numBits() - forSignBit))) + else if (targetType.isSigned() && -m_value.numerator() <= (u256(1) << (targetType.numBits() - forSignBit))) return true; return false; } |