summaryrefslogtreecommitdiffstats
path: root/llvm/lib
diff options
context:
space:
mode:
authorReid Spencer <rspencer@reidspencer.com>2007-05-19 00:29:55 +0000
committerReid Spencer <rspencer@reidspencer.com>2007-05-19 00:29:55 +0000
commitb6af1aae357bc11d70259ed1327a0e0c75383697 (patch)
tree518a34dfae77e68245bde3d6d52b8fb631152d0e /llvm/lib
parentc12dd5207d68fe7771cd0ad08859180e67499ca5 (diff)
downloadbcm5719-llvm-b6af1aae357bc11d70259ed1327a0e0c75383697.tar.gz
bcm5719-llvm-b6af1aae357bc11d70259ed1327a0e0c75383697.zip
Fix an assertion introduced by my last change to the toString method. We
can't use getZExtValue() to extract the low order bits for each digit. Instead, we need to access the low order word directly. llvm-svn: 37242
Diffstat (limited to 'llvm/lib')
-rw-r--r--llvm/lib/Support/APInt.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/llvm/lib/Support/APInt.cpp b/llvm/lib/Support/APInt.cpp
index 49945d84978..267aaf81d44 100644
--- a/llvm/lib/Support/APInt.cpp
+++ b/llvm/lib/Support/APInt.cpp
@@ -1962,9 +1962,9 @@ std::string APInt::toString(uint8_t radix, bool wantSigned) const {
uint64_t mask = radix - 1;
APInt zero(tmp.getBitWidth(), 0);
while (tmp.ne(zero)) {
- unsigned digit = tmp.getZExtValue() & mask;
- tmp = tmp.lshr(shift);
+ unsigned digit = (tmp.isSingleWord() ? tmp.VAL : tmp.pVal[0]) & mask;
result.insert(insert_at, digits[digit]);
+ tmp = tmp.lshr(shift);
}
}
return result;
OpenPOWER on IntegriCloud