From 6a39e49a6cdeb28a04a3657bb6a22f848d5dfa9d Mon Sep 17 00:00:00 2001 From: Ulf Hermann Date: Fri, 27 Apr 2018 10:38:18 +0200 Subject: 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 --- src/3rdparty/double-conversion/fixed-dtoa.cc | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src/3rdparty/double-conversion/fixed-dtoa.cc') 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(high_bits_ >> (position - 64)) & 1; } else { @@ -259,7 +259,8 @@ static void FillFractionals(uint64_t fractionals, int exponent, fractionals -= static_cast(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. -- cgit v1.2.3