diff options
author | John McCall <rjmccall@apple.com> | 2009-12-24 08:52:06 +0000 |
---|---|---|
committer | John McCall <rjmccall@apple.com> | 2009-12-24 08:52:06 +0000 |
commit | 38768295a34beb6b16d9c536597798aadbd132de (patch) | |
tree | cbebc11d519fc91ad59f3b570df7c0c03770353e /lib/Support | |
parent | 80535e0ea064c7185c03a440ea664dd58e2b10ab (diff) | |
download | external_llvm-38768295a34beb6b16d9c536597798aadbd132de.zip external_llvm-38768295a34beb6b16d9c536597798aadbd132de.tar.gz external_llvm-38768295a34beb6b16d9c536597798aadbd132de.tar.bz2 |
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
Diffstat (limited to 'lib/Support')
-rw-r--r-- | lib/Support/APInt.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/Support/APInt.cpp b/lib/Support/APInt.cpp index 56d4773..9532e1e 100644 --- a/lib/Support/APInt.cpp +++ b/lib/Support/APInt.cpp @@ -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; } |