From: Daniel Arndt Date: Sat, 17 Nov 2018 11:31:49 +0000 (+0100) Subject: Avoid integer overflow in Utilities::pack_integers X-Git-Tag: v9.1.0-rc1~557^2 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d2f0357ebbe95fa022677f4ae2102f3634509d7c;p=dealii.git Avoid integer overflow in Utilities::pack_integers --- 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)