From 20a5d257e14060134d14c4b1630438df709971d4 Mon Sep 17 00:00:00 2001 From: Francois Berder Date: Fri, 14 Jun 2024 16:55:15 +0200 Subject: [PATCH] fixup! fixup! Truncate value of increment/decrement operator --- lib/vf_common.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/vf_common.cpp b/lib/vf_common.cpp index d61b83676c2..ae1f4a43d8f 100644 --- a/lib/vf_common.cpp +++ b/lib/vf_common.cpp @@ -98,7 +98,7 @@ namespace ValueFlow if (value_size == 0) return value; - const MathLib::biguint unsignedMaxValue = std::numeric_limits::max() >> (value_size < sizeof(unsignedMaxValue) ? ((sizeof(unsignedMaxValue) - value_size) * 8) : 0); + const MathLib::biguint unsignedMaxValue = std::numeric_limits::max() >> ((sizeof(unsignedMaxValue) - value_size) * 8); const MathLib::biguint signBit = 1ULL << (value_size * 8 - 1); value &= unsignedMaxValue; if (dst_sign == ValueType::Sign::SIGNED && (value & signBit))