From 29203bbeab032b29887be1b74c788367a93a9949 Mon Sep 17 00:00:00 2001 From: Thiago Macieira Date: Tue, 22 Mar 2011 15:20:09 +0100 Subject: Fix a bug in the SSE2 UTF-8 decoder. If the multibyte sequence crossed the end of the SSE2 area, then len would have a wrong value and the data wouldn't be read. --- tests/benchmarks/corelib/tools/qstring/main.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tests/benchmarks/corelib/tools/qstring/main.cpp b/tests/benchmarks/corelib/tools/qstring/main.cpp index 0074a2e..b2d9327 100644 --- a/tests/benchmarks/corelib/tools/qstring/main.cpp +++ b/tests/benchmarks/corelib/tools/qstring/main.cpp @@ -2205,7 +2205,9 @@ int fromUtf8_sse2_optimised_for_ascii(ushort *qch, const char *chars, int len) // UTF-8 character found // which one? counter += bsf_nonzero(highbytes); + len += 16; extract_utf8_multibyte(dst, chars, counter, len); + len -= 16; } len += 16; @@ -2252,7 +2254,9 @@ int fromUtf8_sse2_trusted_no_bom(ushort *qch, const char *chars, int len) // UTF-8 character found // which one? counter += bsf_nonzero(highbytes); + len += 16; extract_utf8_multibyte(dst, chars, counter, len); + len -= 16; } len += 16; -- cgit v0.12