mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-01-14 00:32:55 +00:00
Don't potentially read past the end of the fill data when making a NaN from
an APInt. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@97467 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
81607c902f
commit
d44c6cc477
@ -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;
|
||||
|
Loading…
x
Reference in New Issue
Block a user