Bug 1329933 - IonMonkey: add 0 to the range if NaN is in the input range, r=nbp

This commit is contained in:
Hannes Verschore 2017-01-16 12:51:26 +01:00
parent cf13e95ac8
commit d3a9026c55

View File

@ -1218,8 +1218,14 @@ Range*
Range::NaNToZero(TempAllocator& alloc, const Range *op)
{
Range* copy = new(alloc) Range(*op);
if (copy->canBeNaN())
if (copy->canBeNaN()) {
copy->max_exponent_ = Range::IncludesInfinity;
if (!copy->canBeZero()) {
Range zero;
zero.setDoubleSingleton(0);
copy->unionWith(&zero);
}
}
copy->refineToExcludeNegativeZero();
return copy;
}