aboutsummaryrefslogtreecommitdiffstats
path: root/lib/Support/ScaledNumber.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'lib/Support/ScaledNumber.cpp')
-rw-r--r--lib/Support/ScaledNumber.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/lib/Support/ScaledNumber.cpp b/lib/Support/ScaledNumber.cpp
index 3fe027b..fc6d4e7 100644
--- a/lib/Support/ScaledNumber.cpp
+++ b/lib/Support/ScaledNumber.cpp
@@ -220,6 +220,9 @@ std::string ScaledNumberBase::toString(uint64_t D, int16_t E, int Width,
} else if (E > -64) {
Above0 = D >> -E;
Below0 = D << (64 + E);
+ } else if (E == -64) {
+ // Special case: shift by 64 bits is undefined behavior.
+ Below0 = D;
} else if (E > -120) {
Below0 = D >> (-E - 64);
Extra = D << (128 + E);