mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 892291: Correctly compute ranges for Math.imul; r=nbp
--HG-- extra : rebase_source : 0b6d8d27bbb01fee911e90fc571f683e175fdbbc
This commit is contained in:
parent
8f99de6740
commit
8f13d83d25
@ -940,6 +940,10 @@ MMul::computeRange()
|
||||
if (canBeNegativeZero())
|
||||
canBeNegativeZero_ = Range::negativeZeroMul(&left, &right);
|
||||
setRange(Range::mul(&left, &right));
|
||||
|
||||
// Truncated multiplications could overflow in both directions
|
||||
if (isTruncated() && !range()->isInt32())
|
||||
setRange(new Range(INT32_MIN, INT32_MAX));
|
||||
}
|
||||
|
||||
void
|
||||
|
10
js/src/jit-test/tests/asm.js/testBug892291.js
Normal file
10
js/src/jit-test/tests/asm.js/testBug892291.js
Normal file
@ -0,0 +1,10 @@
|
||||
function a(stdlib) {
|
||||
"use asm";
|
||||
var imul = stdlib.Math.imul;
|
||||
function f() {
|
||||
return ((imul(-800, 0xf8ba1243)|0) % -1)|0;
|
||||
}
|
||||
return f;
|
||||
}
|
||||
var f = a(this);
|
||||
assertEq(f(), 0);
|
Loading…
Reference in New Issue
Block a user