Bug 973118 - Differential Testing: Different output message involving +x, r=bhackett

This commit is contained in:
Jan de Mooij 2014-02-19 21:15:25 -08:00
parent b27e93c69a
commit 394d6b3c2d
4 changed files with 11 additions and 5 deletions

View File

@ -0,0 +1,4 @@
function h(x) { return +x == x };
h(false)
assertEq(h(null), false);
assertEq(h(null), false);

View File

@ -1584,7 +1584,7 @@ MacroAssembler::convertValueToInt(ValueOperand value, MDefinition *maybeInput,
Label done, isInt32, isBool, isDouble, isNull, isString;
branchEqualTypeIfNeeded(MIRType_Int32, maybeInput, tag, &isInt32);
if (conversion == IntConversion_Any)
if (conversion == IntConversion_Any || conversion == IntConversion_NumbersOrBoolsOnly)
branchEqualTypeIfNeeded(MIRType_Boolean, maybeInput, tag, &isBool);
branchEqualTypeIfNeeded(MIRType_Double, maybeInput, tag, &isDouble);

View File

@ -1192,6 +1192,7 @@ class MacroAssembler : public MacroAssemblerSpecific
enum IntConversionInputKind {
IntConversion_NumbersOnly,
IntConversion_NumbersOrBoolsOnly,
IntConversion_Any
};

View File

@ -235,15 +235,16 @@ ComparePolicy::adjustInputs(TempAllocator &alloc, MInstruction *def)
(compare->compareType() == MCompare::Compare_Int32MaybeCoerceLHS && i == 0) ||
(compare->compareType() == MCompare::Compare_Int32MaybeCoerceRHS && i == 1))
{
convert = MacroAssembler::IntConversion_Any;
convert = MacroAssembler::IntConversion_NumbersOrBoolsOnly;
}
if (convert == MacroAssembler::IntConversion_NumbersOnly) {
if (in->type() != MIRType_Int32 && in->type() != MIRType_Value)
in = boxAt(alloc, def, in);
} else {
if (in->type() == MIRType_Undefined ||
in->type() == MIRType_String ||
in->type() == MIRType_Object)
MOZ_ASSERT(convert == MacroAssembler::IntConversion_NumbersOrBoolsOnly);
if (in->type() != MIRType_Int32 &&
in->type() != MIRType_Boolean &&
in->type() != MIRType_Value)
{
in = boxAt(alloc, def, in);
}