From a7a57e2bd0b81f16327d9f8fd36047ba6ce8b626 Mon Sep 17 00:00:00 2001 From: WerWolv Date: Wed, 12 Jan 2022 11:59:08 +0100 Subject: [PATCH] patterns: Fixed local variable truncation --- plugins/libimhex/include/hex/helpers/utils.hpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/plugins/libimhex/include/hex/helpers/utils.hpp b/plugins/libimhex/include/hex/helpers/utils.hpp index 8a1f9e0f2..95f5e1ba8 100644 --- a/plugins/libimhex/include/hex/helpers/utils.hpp +++ b/plugins/libimhex/include/hex/helpers/utils.hpp @@ -116,8 +116,8 @@ namespace hex { } [[nodiscard]] - constexpr uint64_t bitmask(uint8_t bits) { - return (uint64_t(1) << (bits)) - 1; + constexpr u128 bitmask(u8 bits) { + return u128(-1) >> (128 - bits); } template