From 14b9b122111e1c676cd9dc8e09c1e5659951d9f5 Mon Sep 17 00:00:00 2001 From: Nekotekina Date: Fri, 17 Mar 2017 20:22:47 +0300 Subject: [PATCH] Fix UB in BitField.h --- Utilities/BitField.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Utilities/BitField.h b/Utilities/BitField.h index 744905d5a2..a433ca907c 100644 --- a/Utilities/BitField.h +++ b/Utilities/BitField.h @@ -36,7 +36,7 @@ struct bf_t : bf_base // Get bitmask of size N, at I pos static constexpr utype data_mask() { - return static_cast(~utype{} >> (bf_t::bitmax - bf_t::bitsize) << bitpos); + return static_cast(static_cast(~utype{} >> (bf_t::bitmax - bf_t::bitsize)) << bitpos); } // Bitfield extraction helper