From d7e63f23decdaf83aa4872a6e0b2754a3d69d4a6 Mon Sep 17 00:00:00 2001 From: Alex Beregszaszi Date: Tue, 13 Jun 2017 19:12:45 +0100 Subject: Fix UTF-8 validation for high codepoints (>10000) --- test/libsolidity/SolidityNameAndTypeResolution.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'test/libsolidity') diff --git a/test/libsolidity/SolidityNameAndTypeResolution.cpp b/test/libsolidity/SolidityNameAndTypeResolution.cpp index 70934543..0b3cb481 100644 --- a/test/libsolidity/SolidityNameAndTypeResolution.cpp +++ b/test/libsolidity/SolidityNameAndTypeResolution.cpp @@ -2422,6 +2422,16 @@ BOOST_AUTO_TEST_CASE(invalid_utf8_explicit) CHECK_ERROR(sourceCode, TypeError, "Explicit type conversion not allowed"); } +BOOST_AUTO_TEST_CASE(large_utf8_codepoint) +{ + char const* sourceCode = R"( + contract C { + string s = "\xf0\x9f\xa6\x84"; + } + )"; + CHECK_SUCCESS(sourceCode); +} + BOOST_AUTO_TEST_CASE(string_index) { char const* sourceCode = R"( -- cgit