Bug 831087 - IonMonkey: Differential Testing: Getting different output w/without --ion-eager with /= r=mjrosenb a=nonlibxul

This commit is contained in:
Hannes Verschore 2013-01-21 13:26:26 -08:00
parent 6c1b505b0e
commit d5a1119abc
2 changed files with 18 additions and 3 deletions

View File

@ -786,16 +786,16 @@ MDiv::analyzeEdgeCasesForward()
// Try removing divide by zero check // Try removing divide by zero check
if (rhs()->isConstant() && !rhs()->toConstant()->value().isInt32(0)) if (rhs()->isConstant() && !rhs()->toConstant()->value().isInt32(0))
canBeDivideByZero_ = false; canBeDivideByZero_ = false;
// If lhs is a constant int != INT32_MIN, then // If lhs is a constant int != INT32_MIN, then
// negative overflow check can be skipped. // negative overflow check can be skipped.
if (lhs()->isConstant() && !lhs()->toConstant()->value().isInt32(INT32_MIN)) if (lhs()->isConstant() && !lhs()->toConstant()->value().isInt32(INT32_MIN))
setCanBeNegativeZero(false); canBeNegativeOverflow_ = false;
// If rhs is a constant int != -1, likewise. // If rhs is a constant int != -1, likewise.
if (rhs()->isConstant() && !rhs()->toConstant()->value().isInt32(-1)) if (rhs()->isConstant() && !rhs()->toConstant()->value().isInt32(-1))
setCanBeNegativeZero(false); canBeNegativeOverflow_ = false;
// If lhs is != 0, then negative zero check can be skipped. // If lhs is != 0, then negative zero check can be skipped.
if (lhs()->isConstant() && !lhs()->toConstant()->value().isInt32(0)) if (lhs()->isConstant() && !lhs()->toConstant()->value().isInt32(0))

View File

@ -0,0 +1,15 @@
function isNegZero(x) {
return x===0 && (1/x)===-Infinity;
}
try {
for (y = 0; y < 1; y++) {
x = y;
}
} catch (e) {}
function f() {
(x /= -9)
}
f()
assertEq(isNegZero(this.x), true);