mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-17 15:25:52 +00:00
Bug 878435 - In asmjs mode, compare in uint32 mode only if both operands are unsigned. r=luke
This commit is contained in:
parent
e9ecd45e88
commit
9ee14f0649
@ -3985,7 +3985,7 @@ CheckComparison(FunctionCompiler &f, ParseNode *comp, MDefinition **def, Type *t
|
||||
return false;
|
||||
|
||||
if ((lhsType.isSigned() && rhsType.isSigned()) || (lhsType.isUnsigned() && rhsType.isUnsigned())) {
|
||||
MCompare::CompareType compareType = lhsType.isUnsigned()
|
||||
MCompare::CompareType compareType = (lhsType.isUnsigned() && rhsType.isUnsigned())
|
||||
? MCompare::Compare_UInt32
|
||||
: MCompare::Compare_Int32;
|
||||
*def = f.compare(lhsDef, rhsDef, comp->getOp(), compareType);
|
||||
|
11
js/src/jit-test/tests/asm.js/testBug878435.js
Normal file
11
js/src/jit-test/tests/asm.js/testBug878435.js
Normal file
@ -0,0 +1,11 @@
|
||||
function g()
|
||||
{
|
||||
"use asm";
|
||||
function f()
|
||||
{
|
||||
return (0 > (0x80000000 | 0)) | 0;
|
||||
}
|
||||
return f;
|
||||
}
|
||||
|
||||
assertEq(g()(), (0 > (0x80000000 | 0)) | 0);
|
Loading…
Reference in New Issue
Block a user