From c69b218197e97f09bf69f8f7fa3b4677c0f17455 Mon Sep 17 00:00:00 2001 From: Lars Knoll Date: Thu, 14 Nov 2019 15:43:01 +0100 Subject: 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 --- src/corelib/text/qstring.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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); -- cgit v1.2.3