diff options
Diffstat (limited to 'llvm/lib/Support')
| -rw-r--r-- | llvm/lib/Support/APInt.cpp | 2 | 
1 files changed, 1 insertions, 1 deletions
| diff --git a/llvm/lib/Support/APInt.cpp b/llvm/lib/Support/APInt.cpp index 7af0101ece8..3c83e8a749d 100644 --- a/llvm/lib/Support/APInt.cpp +++ b/llvm/lib/Support/APInt.cpp @@ -745,7 +745,7 @@ uint32_t APInt::countLeadingZeros() const {    uint32_t remainder = BitWidth % APINT_BITS_PER_WORD;    if (remainder)      Count -= APINT_BITS_PER_WORD - remainder; -  return Count; +  return std::min(Count, BitWidth);  }  static uint32_t countLeadingOnes_64(uint64_t V, uint32_t skip) { | 

