diff options
-rw-r--r-- | llvm/include/llvm/ADT/APInt.h | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/llvm/include/llvm/ADT/APInt.h b/llvm/include/llvm/ADT/APInt.h index 44b5fd0403f..52509ed000c 100644 --- a/llvm/include/llvm/ADT/APInt.h +++ b/llvm/include/llvm/ADT/APInt.h @@ -564,9 +564,9 @@ public: inline APInt srem(const APInt& RHS) const { if (isNegative()) if (RHS.isNegative()) - return (-(*this)).urem(-RHS); + return -((-(*this)).urem(-RHS)); else - return -((-(*this)).urem(RHS)); + return (-(*this)).urem(RHS); else if (RHS.isNegative()) return -(this->urem(-RHS)); return this->urem(RHS); |