Bug 923659 - IonMonkey: Use null instead of allocating a Range when nothing is known. r=nbp

This commit is contained in:
Dan Gohman 2013-10-15 20:49:43 -07:00
parent eab8d5e710
commit e0cba790bf

View File

@ -760,7 +760,7 @@ Range::min(const Range *lhs, const Range *rhs)
{ {
// If either operand is NaN, the result is NaN. // If either operand is NaN, the result is NaN.
if (lhs->canBeNaN() || rhs->canBeNaN()) if (lhs->canBeNaN() || rhs->canBeNaN())
return new Range(); return nullptr;
return new Range(Min(lhs->lower_, rhs->lower_), return new Range(Min(lhs->lower_, rhs->lower_),
lhs->hasInt32LowerBound_ && rhs->hasInt32LowerBound_, lhs->hasInt32LowerBound_ && rhs->hasInt32LowerBound_,
@ -775,7 +775,7 @@ Range::max(const Range *lhs, const Range *rhs)
{ {
// If either operand is NaN, the result is NaN. // If either operand is NaN, the result is NaN.
if (lhs->canBeNaN() || rhs->canBeNaN()) if (lhs->canBeNaN() || rhs->canBeNaN())
return new Range(); return nullptr;
return new Range(Max(lhs->lower_, rhs->lower_), return new Range(Max(lhs->lower_, rhs->lower_),
lhs->hasInt32LowerBound_ || rhs->hasInt32LowerBound_, lhs->hasInt32LowerBound_ || rhs->hasInt32LowerBound_,