aboutsummaryrefslogtreecommitdiff
path: root/llvm/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
commitb9681ad442c32aec560c4db3a4bc7a59d018f87e (patch)
treebc272a84ee25254ae075ebffaf5b02ada83555f8 /llvm/lib/Support/APInt.cpp
parentc7bd5740eb6f9414965282c08af3f36ad57a0726 (diff)
downloadllvm-b9681ad442c32aec560c4db3a4bc7a59d018f87e.zip
llvm-b9681ad442c32aec560c4db3a4bc7a59d018f87e.tar.gz
llvm-b9681ad442c32aec560c4db3a4bc7a59d018f87e.tar.bz2
fix a bug I introduced, no idea how this didn't repro right.
llvm-svn: 116462
Diffstat (limited to 'llvm/lib/Support/APInt.cpp')
-rw-r--r--llvm/lib/Support/APInt.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/llvm/lib/Support/APInt.cpp b/llvm/lib/Support/APInt.cpp
index 3807314..88f9ac6 100644
--- a/llvm/lib/Support/APInt.cpp
+++ b/llvm/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;
}