From 1e8390d8d6219a2f0a9b8c5592ee0c33c256d03d Mon Sep 17 00:00:00 2001 From: Neil Booth Date: Fri, 12 Oct 2007 15:31:31 +0000 Subject: [PATCH] Don't attempt to mask no bits git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42909 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Support/APInt.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/Support/APInt.cpp b/lib/Support/APInt.cpp index 2e537d66da7..c5abf4bf163 100644 --- a/lib/Support/APInt.cpp +++ b/lib/Support/APInt.cpp @@ -2212,7 +2212,8 @@ APInt::tcExtract(integerPart *dst, unsigned int dstCount, const integerPart *src dst[dstParts - 1] |= ((src[firstSrcPart + dstParts] & mask) << n % integerPartWidth); } else if (n > srcBits) { - dst[dstParts - 1] &= lowBitMask (srcBits % integerPartWidth); + if (srcBits % integerPartWidth) + dst[dstParts - 1] &= lowBitMask (srcBits % integerPartWidth); } /* Clear high parts. */