aboutsummaryrefslogtreecommitdiffstats
path: root/libsolidity/ast
diff options
context:
space:
mode:
Diffstat (limited to 'libsolidity/ast')
-rw-r--r--libsolidity/ast/AST.cpp2
-rw-r--r--libsolidity/ast/AST.h2
2 files changed, 3 insertions, 1 deletions
diff --git a/libsolidity/ast/AST.cpp b/libsolidity/ast/AST.cpp
index 4911f161..62507093 100644
--- a/libsolidity/ast/AST.cpp
+++ b/libsolidity/ast/AST.cpp
@@ -587,5 +587,7 @@ bool Literal::passesAddressChecksum() const
std::string Literal::getChecksummedAddress() const
{
solAssert(isHexNumber(), "Expected hex number");
+ if (value().length != 42)
+ return string();
return dev::getChecksummedAddress(value());
}
diff --git a/libsolidity/ast/AST.h b/libsolidity/ast/AST.h
index 5d6763ca..feffde64 100644
--- a/libsolidity/ast/AST.h
+++ b/libsolidity/ast/AST.h
@@ -1613,7 +1613,7 @@ public:
bool looksLikeAddress() const;
/// @returns true if it passes the address checksum test.
bool passesAddressChecksum() const;
- /// @returns the checksummed version of an address
+ /// @returns the checksummed version of an address (or empty string if not valid)
std::string getChecksummedAddress() const;
private: