Merge pull request #10801 from ClickHouse/fix-msan-report-token

Fix (false) MSan report in MergeTreeIndexFullText
This commit is contained in:
alexey-milovidov 2020-05-11 08:27:46 +03:00 committed by GitHub
commit 1aba7e45f9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -14,6 +14,7 @@
#include <Parsers/ASTIdentifier.h> #include <Parsers/ASTIdentifier.h>
#include <Parsers/ASTLiteral.h> #include <Parsers/ASTLiteral.h>
#include <Parsers/ASTSubquery.h> #include <Parsers/ASTSubquery.h>
#include <Core/Defines.h>
#include <Poco/Logger.h> #include <Poco/Logger.h>
@ -617,7 +618,7 @@ bool SplitTokenExtractor::next(const char * data, size_t len, size_t * pos, size
while (*pos < len) while (*pos < len)
{ {
#if defined(__SSE2__) #if defined(__SSE2__) && !defined(MEMORY_SANITIZER) /// We read uninitialized bytes and decide on the calcualted mask
// NOTE: we assume that `data` string is padded from the right with 15 bytes. // NOTE: we assume that `data` string is padded from the right with 15 bytes.
const __m128i haystack = _mm_loadu_si128(reinterpret_cast<const __m128i *>(data + *pos)); const __m128i haystack = _mm_loadu_si128(reinterpret_cast<const __m128i *>(data + *pos));
const size_t haystack_length = 16; const size_t haystack_length = 16;
@ -691,7 +692,7 @@ bool SplitTokenExtractor::next(const char * data, size_t len, size_t * pos, size
#endif #endif
} }
#if defined(__SSE2__) #if defined(__SSE2__) && !defined(MEMORY_SANITIZER)
// Could happen only if string is not padded with zeroes, and we accidentally hopped over end of data. // Could happen only if string is not padded with zeroes, and we accidentally hopped over end of data.
if (*token_start > len) if (*token_start > len)
return false; return false;