diff --git a/js/src/ion/RangeAnalysis.cpp b/js/src/ion/RangeAnalysis.cpp index 348c28af235c..897681ae9065 100644 --- a/js/src/ion/RangeAnalysis.cpp +++ b/js/src/ion/RangeAnalysis.cpp @@ -682,8 +682,13 @@ MAbs::computeRange() Range other(getOperand(0)); - Range *range = new Range(0, - Max(Abs(other.lower()), Abs(other.upper())), + int64_t max = 0; + if (other.isInt32()) + max = Max(Abs(other.lower()), Abs(other.upper())); + else + max = RANGE_INF_MAX; + + Range *range = new Range(0, max, other.isDecimal(), other.exponent()); setRange(range); diff --git a/js/src/jit-test/tests/ion/bug888568.js b/js/src/jit-test/tests/ion/bug888568.js new file mode 100644 index 000000000000..82102865f4be --- /dev/null +++ b/js/src/jit-test/tests/ion/bug888568.js @@ -0,0 +1,5 @@ +function f() { + return (42.0 + Math.abs(1.0e60)) | 0; +} +assertEq(f(), 0); +assertEq(f(), 0);