aboutsummaryrefslogtreecommitdiffstats
path: root/Types.cpp
diff options
context:
space:
mode:
authorChristian <c@ethdev.com>2014-12-28 20:35:58 +0800
committerChristian <c@ethdev.com>2014-12-28 20:35:58 +0800
commit8442974617e7d3b357144bd88c64904a12cd976f (patch)
treef578de8f7dd169eb4eeaef157b89feaa1e292790 /Types.cpp
parent7dc7827907087c25d89589244f7fa57f5a66e48d (diff)
downloaddexon-solidity-8442974617e7d3b357144bd88c64904a12cd976f.tar.gz
dexon-solidity-8442974617e7d3b357144bd88c64904a12cd976f.tar.zst
dexon-solidity-8442974617e7d3b357144bd88c64904a12cd976f.zip
Clarified binary operator checking for integer types.
Diffstat (limited to 'Types.cpp')
-rw-r--r--Types.cpp20
1 files changed, 10 insertions, 10 deletions
diff --git a/Types.cpp b/Types.cpp
index 664b56ff..c87ce2e6 100644
--- a/Types.cpp
+++ b/Types.cpp
@@ -201,17 +201,17 @@ TypePointer IntegerType::binaryOperatorResultImpl(Token::Value _operator, TypePo
if (!commonType)
return TypePointer();
+ // All integer types can be compared
+ if (Token::isCompareOp(_operator))
+ return commonType;
+
+ // Nothing else can be done with addresses, but hashes can receive bit operators
if (commonType->isAddress())
- {
- if (!Token::isCompareOp(_operator))
- return TypePointer();
- }
- else if (commonType->isHash())
- {
- if (!(Token::isCompareOp(_operator) || Token::isBitOp(_operator)))
- return TypePointer();
- }
- return commonType;
+ return TypePointer();
+ else if (commonType->isHash() && !Token::isBitOp(_operator))
+ return TypePointer();
+ else
+ return commonType;
}
const MemberList IntegerType::AddressMemberList =