summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThiago Macieira <thiago.macieira@intel.com>2020-04-08 17:39:29 -0300
committerThiago Macieira <thiago.macieira@intel.com>2020-05-07 22:43:04 -0700
commit3144f90d93c2b6209e3b8a65bb9655cc7c6ada79 (patch)
treed57e39bb4e2e145dec4e046f90efc8361611ddee
parentb4a05b123343f0412973f0848bf8443d1fbc046b (diff)
QString: mark qustrlen() as unsuitable for ASan
We load an aligned 16-byte on the first load, even if 14 of the 16 bytes are before the string contents themselves. Pick-To: 5.15 Change-Id: Ibdc95e9af7bd456a94ecfffd1603f2b8c87655b1 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
-rw-r--r--src/corelib/text/qstring.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/corelib/text/qstring.cpp b/src/corelib/text/qstring.cpp
index 440369c674..348276810b 100644
--- a/src/corelib/text/qstring.cpp
+++ b/src/corelib/text/qstring.cpp
@@ -159,6 +159,11 @@ static inline bool qt_ends_with(QStringView haystack, QStringView needle, Qt::Ca
static inline bool qt_ends_with(QStringView haystack, QLatin1String needle, Qt::CaseSensitivity cs);
static inline bool qt_ends_with(QStringView haystack, QChar needle, Qt::CaseSensitivity cs);
+#if defined(__SSE2__) && defined(Q_CC_GNU) && !defined(Q_CC_INTEL)
+// We may overrun the buffer, but that's a false positive:
+// this won't crash nor produce incorrect results
+__attribute__((__no_sanitize_address__))
+#endif
qsizetype QtPrivate::qustrlen(const ushort *str) noexcept
{
qsizetype result = 0;