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:
parent
287ace562e
commit
c69b218197
@ -163,7 +163,7 @@ qsizetype QtPrivate::qustrlen(const ushort *str) noexcept
|
|||||||
{
|
{
|
||||||
qsizetype result = 0;
|
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
|
// find the 16-byte alignment immediately prior or equal to str
|
||||||
quintptr misalignment = quintptr(str) & 0xf;
|
quintptr misalignment = quintptr(str) & 0xf;
|
||||||
Q_ASSERT((misalignment & 1) == 0);
|
Q_ASSERT((misalignment & 1) == 0);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user