aboutsummaryrefslogtreecommitdiff
path: root/lib/Support/APInt.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'lib/Support/APInt.cpp')
-rw-r--r--lib/Support/APInt.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/Support/APInt.cpp b/lib/Support/APInt.cpp
index 49945d8497..267aaf81d4 100644
--- a/lib/Support/APInt.cpp
+++ b/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;