The test uses the old-but-invalid trick of inheriting from a class X to gain access to its private or protected parts, but then just casting an object of dynamic type X to the newly derived class. This is invalid, because the object is not actually of the newly-derived type. Says UBSan (excerpt): tst_qtextedit.cpp:2273:5: runtime error: downcast of address 0x60400013c190 which does not point to an object of type 'PublicTextEdit' 0x60400013c190: note: object is of type 'QTextEdit' 00 00 00 00 70 bc 57 df b1 7f 00 00 80 66 30 00 90 61 00 00 70 be 57 df b1 7f 00 00 00 00 be be ^~~~~~~~~~~~~~~~~~~~~~~ vptr for 'QTextEdit' To fix, make QTextEdit befriend tst_QTextEdit. This is how we do it elsewhere, too. Then remove the now-unused PublicTextEdit helper. Amends the start of the public history, and, in one function, 56f0ebfe860e440dcbba8997f44836debc901119 (which is only in Qt 6.4+, so the cherry-pick to 5.15 will have to drop the part in pasteFromMarkdown(). Pick-to: 6.8 6.5 5.15 Change-Id: I967238d84cae0f6dd8f05d0afb7a318292d96415 Reviewed-by: Axel Spoerl <axel.spoerl@qt.io> (cherry picked from commit 73fc32af1410b54fc38d7450fad04bb9dabec077) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
…
Description
Languages
C++
84.3%
HTML
4.9%
C
3.9%
CMake
3.6%
Objective-C++
2%
Other
0.8%