You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@doris.apache.org by mo...@apache.org on 2022/06/19 02:29:06 UTC

[doris] branch master updated: [fix](reader)replace an auto with size_t to avoid integer overflow (#10163)

This is an automated email from the ASF dual-hosted git repository.

morningman pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/doris.git


The following commit(s) were added to refs/heads/master by this push:
     new ffe466cbc7 [fix](reader)replace an auto with size_t to avoid integer overflow (#10163)
ffe466cbc7 is described below

commit ffe466cbc7558733f1e36ce04c2d8d295081979b
Author: SleepyBear <ka...@live.cn>
AuthorDate: Sun Jun 19 10:29:01 2022 +0800

    [fix](reader)replace an auto with size_t to avoid integer overflow (#10163)
---
 be/src/olap/rowset/segment_v2/binary_dict_page.cpp | 2 +-
 be/src/olap/rowset/segment_v2/binary_plain_page.h  | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/be/src/olap/rowset/segment_v2/binary_dict_page.cpp b/be/src/olap/rowset/segment_v2/binary_dict_page.cpp
index b7a7c07681..b53ff52ade 100644
--- a/be/src/olap/rowset/segment_v2/binary_dict_page.cpp
+++ b/be/src/olap/rowset/segment_v2/binary_dict_page.cpp
@@ -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];
diff --git a/be/src/olap/rowset/segment_v2/binary_plain_page.h b/be/src/olap/rowset/segment_v2/binary_plain_page.h
index 58dad51b90..cac9da3709 100644
--- a/be/src/olap/rowset/segment_v2/binary_plain_page.h
+++ b/be/src/olap/rowset/segment_v2/binary_plain_page.h
@@ -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];


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org