зеркало из https://github.com/mozilla/gecko-dev.git
Bug 998167 - IonMonkey: Fix signed integer undefined behavior r=nbp
This commit is contained in:
Родитель
8c1c3c1373
Коммит
ad4273ba8f
|
@ -95,16 +95,14 @@ EvaluateConstantOperands(TempAllocator &alloc, MBinaryInstruction *ins, bool *pt
|
|||
ret = Int32Value(lhs.toInt32() ^ rhs.toInt32());
|
||||
break;
|
||||
case MDefinition::Op_Lsh:
|
||||
ret = Int32Value(lhs.toInt32() << (rhs.toInt32() & 0x1F));
|
||||
ret = Int32Value(uint32_t(lhs.toInt32()) << (rhs.toInt32() & 0x1F));
|
||||
break;
|
||||
case MDefinition::Op_Rsh:
|
||||
ret = Int32Value(lhs.toInt32() >> (rhs.toInt32() & 0x1F));
|
||||
break;
|
||||
case MDefinition::Op_Ursh: {
|
||||
uint32_t unsignedLhs = (uint32_t)lhs.toInt32();
|
||||
ret.setNumber(uint32_t(unsignedLhs >> (rhs.toInt32() & 0x1F)));
|
||||
case MDefinition::Op_Ursh:
|
||||
ret.setNumber(uint32_t(lhs.toInt32()) >> (rhs.toInt32() & 0x1F));
|
||||
break;
|
||||
}
|
||||
case MDefinition::Op_Add:
|
||||
ret.setNumber(lhs.toNumber() + rhs.toNumber());
|
||||
break;
|
||||
|
|
Загрузка…
Ссылка в новой задаче