mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 878444: in Range Analysis, give an empty range for |Infinity % x|; r=bhackett
This commit is contained in:
parent
03b5b62244
commit
8bfebd11eb
@ -726,6 +726,11 @@ MMod::computeRange()
|
||||
return;
|
||||
Range lhs(getOperand(0));
|
||||
Range rhs(getOperand(1));
|
||||
|
||||
// Infinite % x is NaN
|
||||
if (lhs.isInfinite())
|
||||
return;
|
||||
|
||||
int64_t a = Abs<int64_t>(rhs.lower());
|
||||
int64_t b = Abs<int64_t>(rhs.upper());
|
||||
if (a == 0 && b == 0)
|
||||
|
26
js/src/jit-test/tests/ion/bug878444.js
Normal file
26
js/src/jit-test/tests/ion/bug878444.js
Normal file
@ -0,0 +1,26 @@
|
||||
function g()
|
||||
{
|
||||
function f(v) {
|
||||
v = +v;
|
||||
var infinity = 0.0;
|
||||
var three = 0.0;
|
||||
var nan = 0.;
|
||||
var result = 0;
|
||||
|
||||
infinity = 1.0 / 0.0;
|
||||
three = v + 2.0;
|
||||
nan = (infinity % three);
|
||||
result = ~~(nan + 42.0);
|
||||
|
||||
return result | 0;
|
||||
}
|
||||
return f
|
||||
}
|
||||
|
||||
g = g()
|
||||
var x;
|
||||
for(i=0; i < 20000; ++i)
|
||||
{
|
||||
x = g(1.0)
|
||||
}
|
||||
assertEq(x, 0);
|
Loading…
Reference in New Issue
Block a user