mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-08-07 12:28:24 +00:00
Set Remainder before Quotient in case Quotient and LHS alias. The new
order should be immune to such problems. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92124 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -2012,8 +2012,8 @@ void APInt::udivrem(const APInt &LHS, const APInt &RHS,
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (lhsWords < rhsWords || LHS.ult(RHS)) {
|
if (lhsWords < rhsWords || LHS.ult(RHS)) {
|
||||||
Quotient = 0; // X / Y ===> 0, iff X < Y
|
|
||||||
Remainder = LHS; // X % Y ===> X, iff X < Y
|
Remainder = LHS; // X % Y ===> X, iff X < Y
|
||||||
|
Quotient = 0; // X / Y ===> 0, iff X < Y
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user