Repository: systemml
Updated Branches:
  refs/heads/master 5f9266a4d -> cf200e1dd


[SYSTEMML-2045] Fix integer overflow in large dense blocks

This patch fixes an integer overflow in obtaining the current capacity
of a large dense block, which had particularly ugly consequences because
each check for allocated blocks lead to a reallocation of the underlying
arrays (due to the incorrectly computed size).


Project: http://git-wip-us.apache.org/repos/asf/systemml/repo
Commit: http://git-wip-us.apache.org/repos/asf/systemml/commit/cf200e1d
Tree: http://git-wip-us.apache.org/repos/asf/systemml/tree/cf200e1d
Diff: http://git-wip-us.apache.org/repos/asf/systemml/diff/cf200e1d

Branch: refs/heads/master
Commit: cf200e1ddaec050195cf9fb6f1f4c63fdc5973f8
Parents: 5f9266a
Author: Matthias Boehm <[email protected]>
Authored: Wed Jan 3 20:41:10 2018 -0800
Committer: Matthias Boehm <[email protected]>
Committed: Wed Jan 3 20:41:28 2018 -0800

----------------------------------------------------------------------
 .../java/org/apache/sysml/runtime/matrix/data/DenseBlockLDRB.java  | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/systemml/blob/cf200e1d/src/main/java/org/apache/sysml/runtime/matrix/data/DenseBlockLDRB.java
----------------------------------------------------------------------
diff --git 
a/src/main/java/org/apache/sysml/runtime/matrix/data/DenseBlockLDRB.java 
b/src/main/java/org/apache/sysml/runtime/matrix/data/DenseBlockLDRB.java
index fec0d60..b356b6f 100644
--- a/src/main/java/org/apache/sysml/runtime/matrix/data/DenseBlockLDRB.java
+++ b/src/main/java/org/apache/sysml/runtime/matrix/data/DenseBlockLDRB.java
@@ -111,7 +111,7 @@ public class DenseBlockLDRB extends DenseBlock
 
        @Override
        public long capacity() {
-               int len = 0;
+               long len = 0;
                for(int i=0; i<numBlocks(); i++)
                        len += data[i].length;
                return len;

Reply via email to