aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Token.h1
-rw-r--r--Types.cpp2
-rw-r--r--Types.h4
3 files changed, 7 insertions, 0 deletions
diff --git a/Token.h b/Token.h
index 43a5b90b..7c7b1c7f 100644
--- a/Token.h
+++ b/Token.h
@@ -366,6 +366,7 @@ public:
}
static bool isBitOp(Value op) { return (BitOr <= op && op <= SHR) || op == BitNot; }
+ static bool isBooleanOp(Value op) { return (Or <= op && op <= And) || op == Not; }
static bool isUnaryOp(Value op) { return (Not <= op && op <= Delete) || op == Add || op == Sub || op == After; }
static bool isCountOp(Value op) { return op == Inc || op == Dec; }
static bool isShiftOp(Value op) { return (SHL <= op) && (op <= SHR); }
diff --git a/Types.cpp b/Types.cpp
index 6a8d33dc..bda68356 100644
--- a/Types.cpp
+++ b/Types.cpp
@@ -313,6 +313,8 @@ TypePointer IntegerType::binaryOperatorResult(Token::Value _operator, TypePointe
// All integer types can be compared
if (Token::isCompareOp(_operator))
return commonType;
+ if (Token::isBooleanOp(_operator))
+ return TypePointer();
// Nothing else can be done with addresses
if (commonType->isAddress())
return TypePointer();
diff --git a/Types.h b/Types.h
index bc499d59..c4992cfd 100644
--- a/Types.h
+++ b/Types.h
@@ -409,6 +409,10 @@ public:
DataLocation location() const { return m_location; }
virtual TypePointer unaryOperatorResult(Token::Value _operator) const override;
+ virtual TypePointer binaryOperatorResult(Token::Value, TypePointer const&) const override
+ {
+ return TypePointer();
+ }
virtual unsigned memoryHeadSize() const override { return 32; }
/// @returns a copy of this type with location (recursively) changed to @a _location,