mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Fix strings interpreted as addresses.
This commit is contained in:
parent
9eaf26a359
commit
f340ff8764
@ -534,6 +534,8 @@ bool Literal::looksLikeAddress() const
|
|||||||
{
|
{
|
||||||
if (subDenomination() != SubDenomination::None)
|
if (subDenomination() != SubDenomination::None)
|
||||||
return false;
|
return false;
|
||||||
|
if (token() != Token::Number)
|
||||||
|
return false;
|
||||||
|
|
||||||
string lit = value();
|
string lit = value();
|
||||||
return lit.substr(0, 2) == "0x" && abs(int(lit.length()) - 42) <= 1;
|
return lit.substr(0, 2) == "0x" && abs(int(lit.length()) - 42) <= 1;
|
||||||
|
Loading…
Reference in New Issue
Block a user