Avoid asan errors

The SSE code can read slightly outside the bounds of the string.
This is ok, as it's limited to 16 byte boundaries and thus can't
cause a segfault. But it does cause a crash with asan.

Change-Id: Id6e4a550579dc6228f365357773b392ecfd41471
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
This commit is contained in:
Lars Knoll 2019-11-14 15:43:01 +01:00
parent 287ace562e
commit c69b218197

View File

@ -163,7 +163,7 @@ qsizetype QtPrivate::qustrlen(const ushort *str) noexcept
{
qsizetype result = 0;
#ifdef __SSE2__
#if defined(__SSE2__) && !(defined(__SANITIZE_ADDRESS__) || QT_HAS_FEATURE(address_sanitizer))
// find the 16-byte alignment immediately prior or equal to str
quintptr misalignment = quintptr(str) & 0xf;
Q_ASSERT((misalignment & 1) == 0);