aboutsummaryrefslogtreecommitdiffstats
path: root/libsolidity
diff options
context:
space:
mode:
authorYoichi Hirai <i@yoichihirai.com>2016-10-25 02:12:31 +0800
committerYoichi Hirai <i@yoichihirai.com>2016-10-25 22:49:10 +0800
commit3ca5900b8c0b69d640ef46388b0d2250275356fc (patch)
tree33d044a39ec84cd20c505b62c0d440ad78ee6617 /libsolidity
parent578b02bb37bf7cc2fa8cdcb745eaeef5591ea27e (diff)
downloaddexon-solidity-3ca5900b8c0b69d640ef46388b0d2250275356fc.tar.gz
dexon-solidity-3ca5900b8c0b69d640ef46388b0d2250275356fc.tar.zst
dexon-solidity-3ca5900b8c0b69d640ef46388b0d2250275356fc.zip
ast: ban signed EXP, fixing #1246
Diffstat (limited to 'libsolidity')
-rw-r--r--libsolidity/ast/Types.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/libsolidity/ast/Types.cpp b/libsolidity/ast/Types.cpp
index 7cfed3c8..7fe97fa7 100644
--- a/libsolidity/ast/Types.cpp
+++ b/libsolidity/ast/Types.cpp
@@ -349,11 +349,14 @@ TypePointer IntegerType::binaryOperatorResult(Token::Value _operator, TypePointe
return commonType;
if (Token::isBooleanOp(_operator))
return TypePointer();
- // Nothing else can be done with addresses
if (auto intType = dynamic_pointer_cast<IntegerType const>(commonType))
{
+ // Nothing else can be done with addresses
if (intType->isAddress())
return TypePointer();
+ // Signed EXP is not allowed
+ if (Token::Exp == _operator && intType->isSigned())
+ return TypePointer();
}
else if (auto fixType = dynamic_pointer_cast<FixedPointType const>(commonType))
if (Token::Exp == _operator)