You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@iotdb.apache.org by ja...@apache.org on 2020/12/14 01:50:36 UTC

[iotdb] branch master updated: Avoid overflow by converting to long (#2209)

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

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


The following commit(s) were added to refs/heads/master by this push:
     new 6787a2e  Avoid overflow by converting to long (#2209)
6787a2e is described below

commit 6787a2edf0cbceaac94436db0cfe93e5395b3ba4
Author: Benedict Jin <as...@apache.org>
AuthorDate: Mon Dec 14 09:50:19 2020 +0800

    Avoid overflow by converting to long (#2209)
---
 .../main/java/org/apache/iotdb/db/utils/datastructure/TVList.java   | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/server/src/main/java/org/apache/iotdb/db/utils/datastructure/TVList.java b/server/src/main/java/org/apache/iotdb/db/utils/datastructure/TVList.java
index 9978529..2fde738 100644
--- a/server/src/main/java/org/apache/iotdb/db/utils/datastructure/TVList.java
+++ b/server/src/main/java/org/apache/iotdb/db/utils/datastructure/TVList.java
@@ -82,11 +82,9 @@ public abstract class TVList {
   public static long tvListArrayMemSize(TSDataType type) {
     long size = 0;
     // time size
-    size +=
-        PrimitiveArrayManager.ARRAY_SIZE * 8;
+    size += (long) PrimitiveArrayManager.ARRAY_SIZE * 8L;
     // value size
-    size +=
-        PrimitiveArrayManager.ARRAY_SIZE * type.getDataTypeSize();
+    size += (long) PrimitiveArrayManager.ARRAY_SIZE * (long) type.getDataTypeSize();
     return size;
   }