From 3fcbb06cab8264310f2c971709925ca66e3b5b2c Mon Sep 17 00:00:00 2001 From: Alexey Milovidov Date: Mon, 11 May 2020 08:04:59 +0300 Subject: [PATCH] Fix MSan report in MergeTreeIndexFullText --- src/Storages/MergeTree/MergeTreeIndexFullText.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/Storages/MergeTree/MergeTreeIndexFullText.cpp b/src/Storages/MergeTree/MergeTreeIndexFullText.cpp index 4d1106e7663..61ea5987e76 100644 --- a/src/Storages/MergeTree/MergeTreeIndexFullText.cpp +++ b/src/Storages/MergeTree/MergeTreeIndexFullText.cpp @@ -14,6 +14,7 @@ #include #include #include +#include #include @@ -617,7 +618,7 @@ bool SplitTokenExtractor::next(const char * data, size_t len, size_t * pos, size 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. const __m128i haystack = _mm_loadu_si128(reinterpret_cast(data + *pos)); const size_t haystack_length = 16; @@ -691,7 +692,7 @@ bool SplitTokenExtractor::next(const char * data, size_t len, size_t * pos, size #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. if (*token_start > len) return false;