mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 867820 - Box boolean inputs to double comparisons when a double conversion isn't possible, r=jandem.
This commit is contained in:
parent
fa7778cfc5
commit
41a2d16cb7
@ -191,6 +191,8 @@ ComparePolicy::adjustInputs(MInstruction *def)
|
||||
convert = MToDouble::NonNullNonStringPrimitives;
|
||||
else if (compare->compareType() == MCompare::Compare_DoubleMaybeCoerceRHS && i == 1)
|
||||
convert = MToDouble::NonNullNonStringPrimitives;
|
||||
if (convert == MToDouble::NumbersOnly && in->type() == MIRType_Boolean)
|
||||
in = boxAt(def, in);
|
||||
replace = MToDouble::New(in, convert);
|
||||
break;
|
||||
}
|
||||
|
18
js/src/jit-test/tests/ion/bug867820.js
Normal file
18
js/src/jit-test/tests/ion/bug867820.js
Normal file
@ -0,0 +1,18 @@
|
||||
|
||||
function AddTestCase(expect, actual) {
|
||||
new TestCase(expect, actual);
|
||||
}
|
||||
function TestCase(e, a) {
|
||||
this.expect = e;
|
||||
getTestCaseResult(e, a);
|
||||
}
|
||||
function getTestCaseResult(expected, actual) {
|
||||
if (actual != expected) {}
|
||||
}
|
||||
AddRegExpCases(false, Math.pow(2,31));
|
||||
AddRegExpCases("", Math.pow(2,30) - 1);
|
||||
function AddRegExpCases(m, l) {
|
||||
AddTestCase("");
|
||||
AddTestCase(m, true);
|
||||
AddTestCase(l, 0);
|
||||
}
|
Loading…
Reference in New Issue
Block a user