From 3371fd5f577ca731314a367af793384f38e16574 Mon Sep 17 00:00:00 2001 From: Will Froom Date: Thu, 28 Aug 2025 12:40:06 +0000 Subject: [PATCH] [ADT] Fix signed integer overflow --- llvm/include/llvm/ADT/DenseMapInfo.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/llvm/include/llvm/ADT/DenseMapInfo.h b/llvm/include/llvm/ADT/DenseMapInfo.h index 930bd4baca31d..ec7a116856bb4 100644 --- a/llvm/include/llvm/ADT/DenseMapInfo.h +++ b/llvm/include/llvm/ADT/DenseMapInfo.h @@ -124,7 +124,8 @@ struct DenseMapInfo< if constexpr (std::is_unsigned_v && sizeof(T) > sizeof(unsigned)) return densemap::detail::mix(Val); else - return static_cast(Val * 37U); + return static_cast(Val * + static_cast>(37U)); } static bool isEqual(const T &LHS, const T &RHS) { return LHS == RHS; }