diff options
author | Marc Mutz <marc.mutz@qt.io> | 2022-07-20 22:01:38 +0200 |
---|---|---|
committer | Qt Cherry-pick Bot <cherrypick_bot@qt-project.org> | 2022-08-05 17:29:25 +0000 |
commit | 5f939abf20c67d5f80734395de1aa65b4990393c (patch) | |
tree | 439bb2243cbe67a3b8c335133ce6f250c2ccae3f | |
parent | 8815d1eafb5b4ce4d520cf923e76755b640f6969 (diff) |
Fix QString::toLatin1() for strings > 16Gi characters on ARM64
More qsizetype truncation to int, this time in the number of chunks in
SIMD processing, so the limit isn't 2Gi, but 16Gi.
Task-number: QTBUG-103531
Change-Id: Ib584c8dc7aa8dedc1cb8181e7d6f20b582c93f8c
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
(cherry picked from commit 0b5d4c3eae8cd8024bc6e1df6321e2ad5deabb76)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
-rw-r--r-- | src/corelib/text/qstring.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/corelib/text/qstring.cpp b/src/corelib/text/qstring.cpp index 0fffcf7289..635b1f2305 100644 --- a/src/corelib/text/qstring.cpp +++ b/src/corelib/text/qstring.cpp @@ -962,10 +962,10 @@ static void qt_to_latin1_internal(uchar *dst, const char16_t *src, qsizetype len // 1) neon has unsigned comparison // 2) packing is done to 64 bits (8 x 8bits component). if (length >= 16) { - const int chunkCount = length >> 3; // divided by 8 + const qsizetype chunkCount = length >> 3; // divided by 8 const uint16x8_t questionMark = vdupq_n_u16('?'); // set const uint16x8_t thresholdMask = vdupq_n_u16(0xff); // set - for (int i = 0; i < chunkCount; ++i) { + for (qsizetype i = 0; i < chunkCount; ++i) { uint16x8_t chunk = vld1q_u16((uint16_t *)src); // load src += 8; |