Set Remainder before Quotient in case Quotient and LHS alias. The new
order should be immune to such problems. llvm-svn: 92124
This commit is contained in:
parent
d538a6d364
commit
bd8d1e35a6
@ -2012,8 +2012,8 @@ void APInt::udivrem(const APInt &LHS, const APInt &RHS,
|
||||
}
|
||||
|
||||
if (lhsWords < rhsWords || LHS.ult(RHS)) {
|
||||
Quotient = 0; // X / Y ===> 0, iff X < Y
|
||||
Remainder = LHS; // X % Y ===> X, iff X < Y
|
||||
Quotient = 0; // X / Y ===> 0, iff X < Y
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user