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>
bb10
Thiago Macieira 2020-04-08 17:39:29 -03:00
parent b4a05b1233
commit 3144f90d93
1 changed files with 5 additions and 0 deletions

View File

@ -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;