projects
/
oota-llvm.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
7247a5f
)
Fix APFloat::getSmallestNormalized so the shift doesn't depend on undefined behavior...
author
Eli Friedman
<eli.friedman@gmail.com>
Wed, 12 Oct 2011 21:56:19 +0000
(21:56 +0000)
committer
Eli Friedman
<eli.friedman@gmail.com>
Wed, 12 Oct 2011 21:56:19 +0000
(21:56 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@141818
91177308
-0d34-0410-b5e6-
96231b3b80d8
lib/Support/APFloat.cpp
patch
|
blob
|
history
diff --git
a/lib/Support/APFloat.cpp
b/lib/Support/APFloat.cpp
index 95df8617fb5c4ead5a87c1ad4c73df0c0427c343..f2388944929bf097ddfddb1bc11c437079a6110e 100644
(file)
--- a/
lib/Support/APFloat.cpp
+++ b/
lib/Support/APFloat.cpp
@@
-3275,7
+3275,7
@@
APFloat APFloat::getSmallestNormalized(const fltSemantics &Sem, bool Negative) {
Val.exponent = Sem.minExponent;
Val.zeroSignificand();
Val.significandParts()[partCountForBits(Sem.precision)-1] |=
- (((integerPart) 1) << ((Sem.precision
% integerPartWidth) - 1
));
+ (((integerPart) 1) << ((Sem.precision
- 1) % integerPartWidth
));
return Val;
}