Bug 1054568 - IonMonkey: Be prepared to check for a remainder after unsigned division r=nbp

This commit is contained in:
Dan Gohman 2014-08-18 11:11:57 -07:00
Родитель f4c41e9a46
Коммит afa8c1dd59
1 изменённых файлов: 8 добавлений и 0 удалений

Просмотреть файл

@ -838,6 +838,14 @@ CodeGeneratorX86Shared::visitUDivOrMod(LUDivOrMod *ins)
masm.mov(ImmWord(0), edx);
masm.udiv(rhs);
// If the remainder is > 0, bailout since this must be a double.
if (ins->mir()->isDiv() && !ins->mir()->toDiv()->canTruncateRemainder()) {
Register remainder = ToRegister(ins->remainder());
masm.testl(remainder, remainder);
if (!bailoutIf(Assembler::NonZero, ins->snapshot()))
return false;
}
// Unsigned div or mod can return a value that's not a signed int32.
// If our users aren't expecting that, bail.
if (!ins->mir()->isTruncated()) {