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:
81607c9
)
Don't potentially read past the end of the fill data when making a NaN from
author
John McCall
<rjmccall@apple.com>
Mon, 1 Mar 2010 18:38:45 +0000
(18:38 +0000)
committer
John McCall
<rjmccall@apple.com>
Mon, 1 Mar 2010 18:38:45 +0000
(18:38 +0000)
an APInt.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@97467
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 16a0c232927e6ed9f50653bbbfa3c5342aefe7d4..619f061862c481b0bc754e5711e141e30e833ea0 100644
(file)
--- a/
lib/Support/APFloat.cpp
+++ b/
lib/Support/APFloat.cpp
@@
-638,7
+638,8
@@
void APFloat::makeNaN(bool SNaN, bool Negative, const APInt *fill)
if (!fill || fill->getNumWords() < numParts)
APInt::tcSet(significand, 0, numParts);
if (fill) {
- APInt::tcAssign(significand, fill->getRawData(), partCount());
+ APInt::tcAssign(significand, fill->getRawData(),
+ std::min(fill->getNumWords(), numParts));
// Zero out the excess bits of the significand.
unsigned bitsToPreserve = semantics->precision - 1;