[fix](reader)replace an auto with size_t to avoid integer overflow (#10163)

This commit is contained in:
SleepyBear
2022-06-19 10:29:01 +08:00
committed by GitHub
parent 5fdd995b4c
commit ffe466cbc7
2 changed files with 2 additions and 2 deletions

View File

@ -291,7 +291,7 @@ Status BinaryDictPageDecoder::next_batch(size_t* n, ColumnBlockView* dst) {
}
// use SIMD instruction to speed up call function `RoundUpToPowerOfTwo`
auto mem_size = 0;
size_t mem_size = 0;
for (int i = 0; i < len; ++i) {
mem_len[i] = BitUtil::RoundUpToPowerOf2Int32(mem_len[i], MemPool::DEFAULT_ALIGNMENT);
mem_size += mem_len[i];

View File

@ -208,7 +208,7 @@ public:
}
// use SIMD instruction to speed up call function `RoundUpToPowerOfTwo`
auto mem_size = 0;
size_t mem_size = 0;
for (int i = 0; i < max_fetch; ++i) {
mem_len[i] = BitUtil::RoundUpToPowerOf2Int32(mem_len[i], MemPool::DEFAULT_ALIGNMENT);
mem_size += mem_len[i];