summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Support/ScaledNumber.cpp
diff options
context:
space:
mode:
authorMichael Ilseman <milseman@apple.com>2014-12-11 19:46:38 +0000
committerMichael Ilseman <milseman@apple.com>2014-12-11 19:46:38 +0000
commit4e654cd66451354b84cac12b1fc0321a451519d6 (patch)
treee51b1605cd6e6a1afcb35f8879dd54f8154f721b /llvm/lib/Support/ScaledNumber.cpp
parent199aeff7dd4b970d41371d6ec5f753b2f5d28576 (diff)
downloadbcm5719-llvm-4e654cd66451354b84cac12b1fc0321a451519d6.tar.gz
bcm5719-llvm-4e654cd66451354b84cac12b1fc0321a451519d6.zip
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
Diffstat (limited to 'llvm/lib/Support/ScaledNumber.cpp')
-rw-r--r--llvm/lib/Support/ScaledNumber.cpp2
1 files changed, 2 insertions, 0 deletions
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<int>::digits)) == 0 &&
+ "undefined behavior");
D <<= Shift;
E = NewE;
OpenPOWER on IntegriCloud