aboutsummaryrefslogtreecommitdiffstats
path: root/libsolidity
diff options
context:
space:
mode:
authorAlex Beregszaszi <alex@rtfs.hu>2017-06-26 19:18:33 +0800
committerGitHub <noreply@github.com>2017-06-26 19:18:33 +0800
commit751ba701bca0fbcae6d74cfdc23a4ac4a1c3dfab (patch)
tree28df091def23265dbc8a29ad3a256f8ae9bd51bc /libsolidity
parenta0b0df2d98f7d4c60fe9fb9e79739c0c09b94365 (diff)
parentc33d818a6835b247f41e0e003b3c063329bff862 (diff)
downloaddexon-solidity-751ba701bca0fbcae6d74cfdc23a4ac4a1c3dfab.tar.gz
dexon-solidity-751ba701bca0fbcae6d74cfdc23a4ac4a1c3dfab.tar.zst
dexon-solidity-751ba701bca0fbcae6d74cfdc23a4ac4a1c3dfab.zip
Merge pull request #2450 from ethereum/addressstring
Fix for strings treated 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;