aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorReid Spencer <rspencer@reidspencer.com>2007-02-28 02:20:49 +0000
committerReid Spencer <rspencer@reidspencer.com>2007-02-28 02:20:49 +0000
commit84b4eeccc70b39f975a82ad098413d129d38a7d3 (patch)
treec79088bad127c50e0cca0f93dfc00aae2841b8a9
parentff6057664636d5ce5e996bdebac1a8e6b3058504 (diff)
getActiveWords should return the number of words, not the index of the
highest active words. Increment its result by one. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34713 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--include/llvm/ADT/APInt.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/include/llvm/ADT/APInt.h b/include/llvm/ADT/APInt.h
index 39ce504aa9..2b2057c4d9 100644
--- a/include/llvm/ADT/APInt.h
+++ b/include/llvm/ADT/APInt.h
@@ -450,7 +450,7 @@ public:
/// APInt. This is used in conjunction with getActiveData to extract the raw
/// value of the APInt.
inline uint32_t getActiveWords() const {
- return whichWord(getActiveBits()-1);
+ return whichWord(getActiveBits()-1) + 1;
}
/// This function returns a pointer to the internal storage of the APInt.