projects
/
platform
/
upstream
/
llvm.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
06da081
)
[APInt] Add an assert to check for divide by zero in udivrem. NFC
author
Craig Topper
<craig.topper@gmail.com>
Fri, 12 May 2017 18:19:01 +0000
(18:19 +0000)
committer
Craig Topper
<craig.topper@gmail.com>
Fri, 12 May 2017 18:19:01 +0000
(18:19 +0000)
udiv and urem already had the same assert.
llvm-svn: 302931
llvm/lib/Support/APInt.cpp
patch
|
blob
|
history
diff --git
a/llvm/lib/Support/APInt.cpp
b/llvm/lib/Support/APInt.cpp
index
a5ffcb2
..
f4aa627
100644
(file)
--- 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) {