aboutsummaryrefslogtreecommitdiffstats
path: root/libsolidity/analysis
diff options
context:
space:
mode:
authorChristian Parpart <christian@parpart.family>2018-10-01 20:36:57 +0800
committerChristian Parpart <christian@ethereum.org>2018-10-02 21:37:15 +0800
commit9fb835b710f7f0dc9f2089df6301f0ce55d1e4aa (patch)
tree8e8787835a7a683e45cde3a975a95a330439c7ac /libsolidity/analysis
parent7609710d4f8e169784c7a8418da702ac236f5e23 (diff)
downloaddexon-solidity-9fb835b710f7f0dc9f2089df6301f0ce55d1e4aa.tar.gz
dexon-solidity-9fb835b710f7f0dc9f2089df6301f0ce55d1e4aa.tar.zst
dexon-solidity-9fb835b710f7f0dc9f2089df6301f0ce55d1e4aa.zip
Fixes #5051 (introduced in #4684), effectively allowing underscores in address literals.
Diffstat (limited to 'libsolidity/analysis')
-rw-r--r--libsolidity/analysis/TypeChecker.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/libsolidity/analysis/TypeChecker.cpp b/libsolidity/analysis/TypeChecker.cpp
index 3d119c82..bc040623 100644
--- a/libsolidity/analysis/TypeChecker.cpp
+++ b/libsolidity/analysis/TypeChecker.cpp
@@ -2398,11 +2398,11 @@ void TypeChecker::endVisit(Literal const& _literal)
_literal.annotation().type = make_shared<AddressType>(StateMutability::Payable);
string msg;
- if (_literal.value().length() != 42) // "0x" + 40 hex digits
+ if (_literal.valueWithoutUnderscores().length() != 42) // "0x" + 40 hex digits
// looksLikeAddress enforces that it is a hex literal starting with "0x"
msg =
"This looks like an address but is not exactly 40 hex digits. It is " +
- to_string(_literal.value().length() - 2) +
+ to_string(_literal.valueWithoutUnderscores().length() - 2) +
" hex digits.";
else if (!_literal.passesAddressChecksum())
{