Details
-
Bug
-
Resolution: Invalid
-
Not Evaluated
-
None
-
6.4.1
-
None
Description
With qt6 i can't use QString::fromUtf16 when string is unaligned. This simple example crashes:
#include <QCoreApplication> #include <QString> #include <QDebug> static const int8_t g_test[12] = { 0x48, 0x0, 0x48, 0x0, 0x0, 0x48, 0x0, 0x48, 0x0, 0x0, 0x0 }; int main(int argc, char *argv[]) { QCoreApplication a(argc, argv); const char* str = (const char*) g_test; auto t1 = QString::fromUtf16((const char16_t*) str); str += 7; // sigsegv auto t2 = QString::fromUtf16((const char16_t*) str); qDebug() << t1; qDebug() << t2; return a.exec(); }
But on same os with qt5.15.8 works fine.
Attachments
Issue Links
- is duplicated by
-
QTBUG-112021 QString::fromWCharArray triggers the assertion: "(misalignment & 1) == 0"
- Closed