aboutsummaryrefslogtreecommitdiff
path: root/lib/Support/APInt.cpp
diff options
context:
space:
mode:
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 3807314bac..88f9ac63f7 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;
}