diff --git a/js/src/ion/MIR.cpp b/js/src/ion/MIR.cpp index 64258579739..e37eeb51cba 100644 --- a/js/src/ion/MIR.cpp +++ b/js/src/ion/MIR.cpp @@ -122,6 +122,11 @@ EvaluateConstantOperands(MBinaryInstruction *ins, bool *ptypeChange = NULL) MOZ_ASSUME_UNREACHABLE("NYI"); } + // setNumber eagerly transforms a number to int32. + // Transform back to double, if the output type is double. + if (ins->type() == MIRType_Double && ret.isInt32()) + ret.setDouble(ret.toNumber()); + if (ins->type() != MIRTypeFromValue(ret)) { if (ptypeChange) *ptypeChange = true;