aboutsummaryrefslogtreecommitdiffstats
path: root/lib/Support/APInt.cpp
diff options
context:
space:
mode:
authorNeil Booth <neil@daikokuya.co.uk>2007-10-12 15:31:31 +0000
committerNeil Booth <neil@daikokuya.co.uk>2007-10-12 15:31:31 +0000
commit69731ff67800fec238fbbc1f59a7833fa797ecac (patch)
treeaa3e95b3f917c8234447ff1fa69194b0577d3ec2 /lib/Support/APInt.cpp
parent36eb6b7103ccca77ac51754a2265340ce9a2a8d7 (diff)
downloadexternal_llvm-69731ff67800fec238fbbc1f59a7833fa797ecac.zip
external_llvm-69731ff67800fec238fbbc1f59a7833fa797ecac.tar.gz
external_llvm-69731ff67800fec238fbbc1f59a7833fa797ecac.tar.bz2
Don't attempt to mask no bits
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42909 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Support/APInt.cpp')
-rw-r--r--lib/Support/APInt.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/Support/APInt.cpp b/lib/Support/APInt.cpp
index 2e537d6..c5abf4b 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. */