aboutsummaryrefslogtreecommitdiffstats
path: root/lib/Support/APInt.cpp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2010-10-14 00:30:00 +0000
committerChris Lattner <sabre@nondot.org>2010-10-14 00:30:00 +0000
commita5bbde8efd9710e5daecee69ff48722e637a35b7 (patch)
tree610f27040ed691c1156d69912a81e43966d66fe1 /lib/Support/APInt.cpp
parent15ea094474924a8cd8507f8b990de0554de0151f (diff)
downloadexternal_llvm-a5bbde8efd9710e5daecee69ff48722e637a35b7.zip
external_llvm-a5bbde8efd9710e5daecee69ff48722e637a35b7.tar.gz
external_llvm-a5bbde8efd9710e5daecee69ff48722e637a35b7.tar.bz2
fix a bug I introduced, no idea how this didn't repro right.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@116462 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Support/APInt.cpp')
-rw-r--r--lib/Support/APInt.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/Support/APInt.cpp b/lib/Support/APInt.cpp
index 3807314..88f9ac6 100644
--- a/lib/Support/APInt.cpp
+++ b/lib/Support/APInt.cpp
@@ -2067,8 +2067,8 @@ APInt APInt::ssub_ov(const APInt &RHS, bool &Overflow) const {
}
APInt APInt::usub_ov(const APInt &RHS, bool &Overflow) const {
- APInt Res = *this+RHS;
- Overflow = Res.ugt(RHS);
+ APInt Res = *this-RHS;
+ Overflow = Res.ugt(*this);
return Res;
}