From d2f0357ebbe95fa022677f4ae2102f3634509d7c Mon Sep 17 00:00:00 2001 From: Daniel Arndt Date: Sat, 17 Nov 2018 12:31:49 +0100 Subject: [PATCH] Avoid integer overflow in Utilities::pack_integers --- source/base/utilities.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/base/utilities.cc b/source/base/utilities.cc index 21c1ea0b60..a16d51a2da 100644 --- a/source/base/utilities.cc +++ b/source/base/utilities.cc @@ -278,7 +278,7 @@ namespace Utilities AssertIndexRange(bits_per_dim * dim, 65); Assert(bits_per_dim > 0, ExcMessage("bits_per_dim should be positive")); - const Integer mask = (1 << bits_per_dim) - 1; + const Integer mask = (Integer(1) << bits_per_dim) - 1; Integer res = 0; for (unsigned int i = 0; i < dim; ++i) -- 2.39.5