Fix UBSan report in mapPopulateSeries

This commit is contained in:
Alexey Milovidov 2021-03-24 23:10:15 +03:00
parent 087be05dfd
commit c325ed65e2

View File

@ -190,7 +190,7 @@ private:
}
static constexpr size_t MAX_ARRAY_SIZE = 1ULL << 30;
if (static_cast<size_t>(max_key - min_key) > MAX_ARRAY_SIZE)
if (static_cast<size_t>(max_key) - static_cast<size_t>(min_key) > MAX_ARRAY_SIZE)
throw Exception(ErrorCodes::TOO_LARGE_ARRAY_SIZE, "Too large array size in the result of function {}", getName());
/* fill the result arrays */