1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2025-02-01 05:01:59 +01:00

[APInt] Add an assert to check for divide by zero in udivrem. NFC

udiv and urem already had the same assert.

llvm-svn: 302931
This commit is contained in:
Craig Topper 2017-05-12 18:19:01 +00:00
parent 043b32ee18
commit 44689ecb8f

View File

@ -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) {