summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Support/APInt.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/lib/Support/APInt.cpp')
-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