summaryrefslogtreecommitdiffstats
path: root/src/3rdparty/double-conversion/fixed-dtoa.cc
diff options
context:
space:
mode:
authorUlf Hermann <ulf.hermann@qt.io>2018-04-27 10:38:18 +0200
committerUlf Hermann <ulf.hermann@qt.io>2018-05-02 14:19:32 +0000
commit6a39e49a6cdeb28a04a3657bb6a22f848d5dfa9d (patch)
tree5378e376b96ebb38d7bd9b16c9d4e400fef217b9 /src/3rdparty/double-conversion/fixed-dtoa.cc
parentfa854f214a3c812e5548ff55d179dd07ef99053b (diff)
Upgrade double-conversion to v3.0.0
This fixes their issue #41, a potential undefined behavior. We preserve the locally added "__ghs" clause as well as the _M_ARM_FP clause necessary for winrt in utils.h. [ChangeLog][Third-Party Code] double-conversion got updated to upstream version 3.0.0. Task-number: QTBUG-66561 Change-Id: Id79125bdeeaebb61dca2e2885d3370accce9030c Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Diffstat (limited to 'src/3rdparty/double-conversion/fixed-dtoa.cc')
-rw-r--r--src/3rdparty/double-conversion/fixed-dtoa.cc5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/3rdparty/double-conversion/fixed-dtoa.cc b/src/3rdparty/double-conversion/fixed-dtoa.cc
index aef65fdc21..0f55a0b6eb 100644
--- a/src/3rdparty/double-conversion/fixed-dtoa.cc
+++ b/src/3rdparty/double-conversion/fixed-dtoa.cc
@@ -98,7 +98,7 @@ class UInt128 {
return high_bits_ == 0 && low_bits_ == 0;
}
- int BitAt(int position) {
+ int BitAt(int position) const {
if (position >= 64) {
return static_cast<int>(high_bits_ >> (position - 64)) & 1;
} else {
@@ -259,7 +259,8 @@ static void FillFractionals(uint64_t fractionals, int exponent,
fractionals -= static_cast<uint64_t>(digit) << point;
}
// If the first bit after the point is set we have to round up.
- if (((fractionals >> (point - 1)) & 1) == 1) {
+ ASSERT(fractionals == 0 || point - 1 >= 0);
+ if ((fractionals != 0) && ((fractionals >> (point - 1)) & 1) == 1) {
RoundUp(buffer, length, decimal_point);
}
} else { // We need 128 bits.