mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-10 11:55:49 +00:00
Bug 505003 - TM: Different values for modulo of negative number (-2 % 2). r=graydon.
--HG-- extra : rebase_source : 73987a251e045b77ddc1cf1eb7c1516da46b2b9f
This commit is contained in:
parent
33d1a6f258
commit
12f2581e38
@ -8156,7 +8156,7 @@ TraceRecorder::alu(LOpcode v, jsdouble v0, jsdouble v1, LIns* s0, LIns* s1)
|
||||
* If the result is zero, we must exit if the lhs is negative since
|
||||
* the result is -0 in this case, which is not in the integer domain.
|
||||
*/
|
||||
guard(false, lir->ins2i(LIR_lt, d1, 0), exit);
|
||||
guard(false, lir->ins2i(LIR_lt, d0, 0), exit);
|
||||
branch->setTarget(lir->ins0(LIR_label));
|
||||
break;
|
||||
}
|
||||
|
7
js/src/trace-test/tests/basic/testModuloWithNegative2.js
Normal file
7
js/src/trace-test/tests/basic/testModuloWithNegative2.js
Normal file
@ -0,0 +1,7 @@
|
||||
function f(v, e) {
|
||||
for (var i = 0; i < 9; i++)
|
||||
v %= e;
|
||||
return v;
|
||||
}
|
||||
f(0, 1);
|
||||
assertEq(f(-2, 2), -0);
|
Loading…
Reference in New Issue
Block a user