From f340ff87645a4b1026bbe7f95ad4f63a955a87a2 Mon Sep 17 00:00:00 2001 From: chriseth Date: Thu, 22 Jun 2017 16:39:42 +0200 Subject: Fix strings interpreted as addresses. --- libsolidity/ast/AST.cpp | 2 ++ 1 file changed, 2 insertions(+) (limited to 'libsolidity') 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; -- cgit v1.2.3