diff options
author | Thiago Macieira <thiago.macieira@intel.com> | 2020-04-08 17:39:29 -0300 |
---|---|---|
committer | Volker Hilsheimer <volker.hilsheimer@qt.io> | 2020-05-20 22:52:13 +0200 |
commit | 5b34f21fc74935d15edd454f1a9ff81f798cef5f (patch) | |
tree | 1ce1a1b8f6a9b268a3933e56247f756850fb4565 /src/corelib/text/qstring.cpp | |
parent | 1001a584ad74be00ea240dc2dffaadc84cd11cde (diff) | |
download | qtbase-5b34f21fc74935d15edd454f1a9ff81f798cef5f.tar.gz |
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.
Change-Id: Ibdc95e9af7bd456a94ecfffd1603f2b8c87655b1
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
(cherry picked from commit 3144f90d93c2b6209e3b8a65bb9655cc7c6ada79)
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Diffstat (limited to 'src/corelib/text/qstring.cpp')
-rw-r--r-- | src/corelib/text/qstring.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/corelib/text/qstring.cpp b/src/corelib/text/qstring.cpp index 70edd7c6e4..3e8e12a59c 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; |