summaryrefslogtreecommitdiffstats
path: root/tests/benchmarks
diff options
context:
space:
mode:
authorThiago Macieira <thiago.macieira@nokia.com>2011-03-22 14:20:09 (GMT)
committerThiago Macieira <thiago.macieira@nokia.com>2011-03-22 14:52:05 (GMT)
commit29203bbeab032b29887be1b74c788367a93a9949 (patch)
tree496f581b148e17626d6ab7b2f97706d7e2ec665f /tests/benchmarks
parent835108c44c0f5263856cb96c257e11600ffbf9e6 (diff)
downloadQt-29203bbeab032b29887be1b74c788367a93a9949.zip
Qt-29203bbeab032b29887be1b74c788367a93a9949.tar.gz
Qt-29203bbeab032b29887be1b74c788367a93a9949.tar.bz2
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.
Diffstat (limited to 'tests/benchmarks')
-rw-r--r--tests/benchmarks/corelib/tools/qstring/main.cpp4
1 files changed, 4 insertions, 0 deletions
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<false>(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<true>(dst, chars, counter, len);
+ len -= 16;
}
len += 16;