aboutsummaryrefslogtreecommitdiffstats
path: root/libsolidity
diff options
context:
space:
mode:
authorchriseth <chris@ethereum.org>2017-06-22 22:39:42 +0800
committerchriseth <chris@ethereum.org>2017-06-22 22:48:44 +0800
commitf340ff87645a4b1026bbe7f95ad4f63a955a87a2 (patch)
treeaf8329cdf7e7a74e5f398f1a2fc0f3a9f4cc1c37 /libsolidity
parent9eaf26a35900eb6c26e098e3caa822038c0dc0fa (diff)
downloaddexon-solidity-f340ff87645a4b1026bbe7f95ad4f63a955a87a2.tar
dexon-solidity-f340ff87645a4b1026bbe7f95ad4f63a955a87a2.tar.gz
dexon-solidity-f340ff87645a4b1026bbe7f95ad4f63a955a87a2.tar.bz2
dexon-solidity-f340ff87645a4b1026bbe7f95ad4f63a955a87a2.tar.lz
dexon-solidity-f340ff87645a4b1026bbe7f95ad4f63a955a87a2.tar.xz
dexon-solidity-f340ff87645a4b1026bbe7f95ad4f63a955a87a2.tar.zst
dexon-solidity-f340ff87645a4b1026bbe7f95ad4f63a955a87a2.zip
Fix strings interpreted as addresses.
Diffstat (limited to 'libsolidity')
-rw-r--r--libsolidity/ast/AST.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/libsolidity/ast/AST.cpp b/libsolidity/ast/AST.cpp
index 40dfa348..b929b6fe 100644
--- a/libsolidity/ast/AST.cpp
+++ b/libsolidity/ast/AST.cpp
@@ -534,6 +534,8 @@ bool Literal::looksLikeAddress() const
{
if (subDenomination() != SubDenomination::None)
return false;
+ if (token() != Token::Number)
+ return false;
string lit = value();
return lit.substr(0, 2) == "0x" && abs(int(lit.length()) - 42) <= 1;