7908b0cea6
Says GCC 12 with -sanitize address -sanitize undefined: qfontengine.cpp: In member function ‘bool QFontEngine::processHheaTable() const’: qfontengine.cpp:386:65: error: array subscript 4 is outside array bounds of ‘const char [1]’ [-Werror=array-bounds] 386 | qint16 ascent = qFromBigEndian<qint16>(hhea.constData() + 4); | ~~~~~~~~~~~~~~~~~^~~ qbytearray.h:56:23: note: at offset 4 into object ‘QByteArray::_empty’ of size 1 56 | static const char _empty; | ^~~~~~ (repeats several times) The compiler apparently assumes that data() and size() are independent of each other, and so finds that that constData() may return &_empty, which is a const char[1]. For some reason, storing the result of constData() in a temporary and indexing off of that fixes the issue. Potentially adding Q_ASSUME(d.data()[d.size] == '\0'); in some strategic place would fix it, too, but would incur runtime overhead. See https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105348 Task-number: QTBUG-103923 Pick-to: 6.3 6.2 Change-Id: Ia6e24e01d1c2a6bd9d91d4d082df9fba0d5c668f Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com> |
||
---|---|---|
.github/workflows | ||
bin | ||
cmake | ||
coin | ||
config.tests | ||
dist | ||
doc | ||
examples | ||
lib | ||
libexec | ||
LICENSES | ||
mkspecs | ||
qmake | ||
src | ||
tests | ||
util | ||
.cmake.conf | ||
.gitattributes | ||
.gitignore | ||
.lgtm.yml | ||
.tag | ||
CMakeLists.txt | ||
conanfile.py | ||
config_help.txt | ||
configure | ||
configure.bat | ||
configure.cmake | ||
dependencies.yaml | ||
qt_cmdline.cmake | ||
sync.profile |