From 4e654cd66451354b84cac12b1fc0321a451519d6 Mon Sep 17 00:00:00 2001 From: Michael Ilseman Date: Thu, 11 Dec 2014 19:46:38 +0000 Subject: Silence static analyzer warnings in LLVMSupport. The static analyzer catches a few potential bugs in LLVMSupport. Add in asserts to silence the warnings. llvm-svn: 224044 --- llvm/lib/Support/ScaledNumber.cpp | 2 ++ 1 file changed, 2 insertions(+) (limited to 'llvm/lib/Support/ScaledNumber.cpp') diff --git a/llvm/lib/Support/ScaledNumber.cpp b/llvm/lib/Support/ScaledNumber.cpp index fc6d4e7be43..725f4649613 100644 --- a/llvm/lib/Support/ScaledNumber.cpp +++ b/llvm/lib/Support/ScaledNumber.cpp @@ -169,6 +169,8 @@ static std::string toStringAPFloat(uint64_t D, int E, unsigned Precision) { int Shift = 63 - (NewE - E); assert(Shift <= LeadingZeros); assert(Shift == LeadingZeros || NewE == ScaledNumbers::MaxScale); + assert((Shift & (1u << std::numeric_limits::digits)) == 0 && + "undefined behavior"); D <<= Shift; E = NewE; -- cgit v1.2.3