From eb6929cb191c1b91dda784697faedcfdb245345a Mon Sep 17 00:00:00 2001 From: Benoit Jacob Date: Mon, 16 Mar 2015 16:15:47 -0400 Subject: [PATCH 1/2] fix bug in maxsize calculation, which would cause products of size > 2048 to address the lookup table out of bounds --- Eigen/src/Core/products/LookupBlockingSizesTable.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Eigen/src/Core/products/LookupBlockingSizesTable.h b/Eigen/src/Core/products/LookupBlockingSizesTable.h index f955253f8..3c8aba6f8 100644 --- a/Eigen/src/Core/products/LookupBlockingSizesTable.h +++ b/Eigen/src/Core/products/LookupBlockingSizesTable.h @@ -59,7 +59,7 @@ struct LookupBlockingSizesFromTableImpl using std::max; typedef BlockingSizesLookupTable Table; const uint16_t minsize = Table::BaseSize; - const uint16_t maxsize = minsize << (Table::NumSizes + 1); + const uint16_t maxsize = minsize << (Table::NumSizes - 1); const uint16_t k_clamped = max(minsize, min(k, maxsize)); const uint16_t m_clamped = max(minsize, min(m, maxsize)); const uint16_t n_clamped = max(minsize, min(n, maxsize)); From 577056aa9400459f1a1bad9e423857bc1763f18f Mon Sep 17 00:00:00 2001 From: Benoit Jacob Date: Mon, 16 Mar 2015 16:21:50 -0400 Subject: [PATCH 2/2] Include stdint.h. Not going for cstdint because it is a C++11 addition. Needed for uint16_t at least, in lookup-table code. --- Eigen/Core | 1 + 1 file changed, 1 insertion(+) diff --git a/Eigen/Core b/Eigen/Core index 1a3249604..80842a1de 100644 --- a/Eigen/Core +++ b/Eigen/Core @@ -61,6 +61,7 @@ #pragma GCC optimize ("-fno-ipa-cp-clone") #endif +#include #include // this include file manages BLAS and MKL related macros