summaryrefslogtreecommitdiffstats
path: root/src/corelib/tools/qstring.cpp
diff options
context:
space:
mode:
authorErik Verbruggen <erik.verbruggen@qt.io>2017-01-24 17:06:03 +0100
committerErik Verbruggen <erik.verbruggen@qt.io>2017-01-26 09:34:46 +0000
commitfa15162700a18ff243de46954bb613988c199ce7 (patch)
tree2bff001dc766649063d1e3418051853eed10698c /src/corelib/tools/qstring.cpp
parent17e672a67ed2ba6c8ec3952ff4ab255cb45fcce6 (diff)
Fix QString comparison on Aarch64
There was an off-by-one error in the while loop for aarch64: we start counting at 0 for the first position, so the last valid input position is "a+7", not 8. This wasn't covered by the tests, nor was the SSE2 version, so now there are also tests for both versions. Change-Id: I7eb8c5708e6179f45ea56885b0e66e1a37969c1d Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Diffstat (limited to 'src/corelib/tools/qstring.cpp')
-rw-r--r--src/corelib/tools/qstring.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/corelib/tools/qstring.cpp b/src/corelib/tools/qstring.cpp
index a727f5168c..fb79ab0e47 100644
--- a/src/corelib/tools/qstring.cpp
+++ b/src/corelib/tools/qstring.cpp
@@ -496,7 +496,7 @@ static int ucstrncmp(const QChar *a, const QChar *b, int l)
if (l >= 8) {
const QChar *end = a + l;
const uint16x8_t mask = { 1, 1 << 1, 1 << 2, 1 << 3, 1 << 4, 1 << 5, 1 << 6, 1 << 7 };
- while (a + 8 < end) {
+ while (a + 7 < end) {
uint16x8_t da = vld1q_u16(reinterpret_cast<const uint16_t *>(a));
uint16x8_t db = vld1q_u16(reinterpret_cast<const uint16_t *>(b));