diff options
author | Craig Topper <craig.topper@gmail.com> | 2017-05-12 18:19:01 +0000 |
---|---|---|
committer | Craig Topper <craig.topper@gmail.com> | 2017-05-12 18:19:01 +0000 |
commit | 4bdd621e93053e2cf7f9b50f6cabed108b8834ca (patch) | |
tree | 5f7c57ce553fcd749fa3999564762c5436849970 /llvm/lib/Support/APInt.cpp | |
parent | 06da0816fdea8fae5460fd177f6378fa403795d0 (diff) | |
download | llvm-4bdd621e93053e2cf7f9b50f6cabed108b8834ca.zip llvm-4bdd621e93053e2cf7f9b50f6cabed108b8834ca.tar.gz llvm-4bdd621e93053e2cf7f9b50f6cabed108b8834ca.tar.bz2 |
[APInt] Add an assert to check for divide by zero in udivrem. NFC
udiv and urem already had the same assert.
llvm-svn: 302931
Diffstat (limited to 'llvm/lib/Support/APInt.cpp')
-rw-r--r-- | llvm/lib/Support/APInt.cpp | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/llvm/lib/Support/APInt.cpp b/llvm/lib/Support/APInt.cpp index a5ffcb2..f4aa627 100644 --- a/llvm/lib/Support/APInt.cpp +++ b/llvm/lib/Support/APInt.cpp @@ -1662,6 +1662,7 @@ void APInt::udivrem(const APInt &LHS, const APInt &RHS, // Get some size facts about the dividend and divisor unsigned lhsWords = getNumWords(LHS.getActiveBits()); unsigned rhsWords = getNumWords(RHS.getActiveBits()); + assert(rhsWords && "Performing divrem operation by zero ???"); // Check the degenerate cases if (lhsWords == 0) { |