Bug 888568 - Range analysis, Handle int32 infinities on MAbs. r=mjrosenb

This commit is contained in:
Nicolas B. Pierron 2013-07-02 17:38:42 -07:00
parent 6d8c63561a
commit 6e8f09cf66
2 changed files with 12 additions and 2 deletions

View File

@ -682,8 +682,13 @@ MAbs::computeRange()
Range other(getOperand(0));
Range *range = new Range(0,
Max(Abs<int64_t>(other.lower()), Abs<int64_t>(other.upper())),
int64_t max = 0;
if (other.isInt32())
max = Max(Abs<int64_t>(other.lower()), Abs<int64_t>(other.upper()));
else
max = RANGE_INF_MAX;
Range *range = new Range(0, max,
other.isDecimal(),
other.exponent());
setRange(range);

View File

@ -0,0 +1,5 @@
function f() {
return (42.0 + Math.abs(1.0e60)) | 0;
}
assertEq(f(), 0);
assertEq(f(), 0);