diff options
author | Lars Knoll <lars.knoll@qt.io> | 2019-11-14 15:43:01 +0100 |
---|---|---|
committer | Lars Knoll <lars.knoll@qt.io> | 2019-12-16 17:38:33 +0100 |
commit | c69b218197e97f09bf69f8f7fa3b4677c0f17455 (patch) | |
tree | 37e148da7c0ce8fdc6f0e108299553789028344f | |
parent | 287ace562ee5ddff22f7dbf4e49ae5f0520f2308 (diff) |
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>
-rw-r--r-- | src/corelib/text/qstring.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/corelib/text/qstring.cpp b/src/corelib/text/qstring.cpp index e61228c4a4..4234b3c402 100644 --- a/src/corelib/text/qstring.cpp +++ b/src/corelib/text/qstring.cpp @@ -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); |