diff options
Diffstat (limited to 'libsolidity')
-rw-r--r-- | libsolidity/ast/ASTJsonConverter.cpp | 3 | ||||
-rw-r--r-- | libsolidity/ast/Types.cpp | 5 |
2 files changed, 3 insertions, 5 deletions
diff --git a/libsolidity/ast/ASTJsonConverter.cpp b/libsolidity/ast/ASTJsonConverter.cpp index 030b32ba..f6b06be6 100644 --- a/libsolidity/ast/ASTJsonConverter.cpp +++ b/libsolidity/ast/ASTJsonConverter.cpp @@ -417,9 +417,8 @@ bool ASTJsonConverter::visit(ElementaryTypeNameExpression const& _node) bool ASTJsonConverter::visit(Literal const& _node) { char const* tokenString = Token::toString(_node.token()); - size_t invalidPos = 0; Json::Value value{_node.value()}; - if (!dev::validate(_node.value(), invalidPos)) + if (!dev::validateUTF8(_node.value())) value = Json::nullValue; Token::Value subdenomination = Token::Value(_node.subDenomination()); addJsonNode(_node, "Literal", { diff --git a/libsolidity/ast/Types.cpp b/libsolidity/ast/Types.cpp index b22f3c08..d9660bc0 100644 --- a/libsolidity/ast/Types.cpp +++ b/libsolidity/ast/Types.cpp @@ -896,7 +896,7 @@ std::string StringLiteralType::toString(bool) const { size_t invalidSequence; - if (!dev::validate(m_value, invalidSequence)) + if (!dev::validateUTF8(m_value, invalidSequence)) return "literal_string (contains invalid UTF-8 sequence at position " + dev::toString(invalidSequence) + ")"; return "literal_string \"" + m_value + "\""; @@ -909,8 +909,7 @@ TypePointer StringLiteralType::mobileType() const bool StringLiteralType::isValidUTF8() const { - size_t dontCare {}; - return dev::validate(m_value, dontCare); + return dev::validateUTF8(m_value); } shared_ptr<FixedBytesType> FixedBytesType::smallestTypeForLiteral(string const& _literal) |