diff --git a/src/corelib/text/qstring.cpp b/src/corelib/text/qstring.cpp index fe8781bc003..10f481fce7e 100644 --- a/src/corelib/text/qstring.cpp +++ b/src/corelib/text/qstring.cpp @@ -1243,8 +1243,9 @@ Q_NEVER_INLINE static int ucstricmp8(const char *utf8, const char *utf8end, cons QStringIterator src2(utf16, utf16end); while (src1 < end1 && src2.hasNext()) { - char32_t uc1 = 0; - char32_t *output = &uc1; + char32_t decoded[1]; + char32_t *output = decoded; + char32_t &uc1 = decoded[0]; uchar b = *src1++; const qsizetype res = QUtf8Functions::fromUtf8(b, output, src1, end1); if (res < 0) {