diff options
Diffstat (limited to 'recipes-qt/qt5/qtbase/0013-Upgrade-double-conversion-to-v3.0.0.patch')
| -rw-r--r-- | recipes-qt/qt5/qtbase/0013-Upgrade-double-conversion-to-v3.0.0.patch | 344 |
1 files changed, 0 insertions, 344 deletions
diff --git a/recipes-qt/qt5/qtbase/0013-Upgrade-double-conversion-to-v3.0.0.patch b/recipes-qt/qt5/qtbase/0013-Upgrade-double-conversion-to-v3.0.0.patch deleted file mode 100644 index 138d1f7f..00000000 --- a/recipes-qt/qt5/qtbase/0013-Upgrade-double-conversion-to-v3.0.0.patch +++ /dev/null | |||
| @@ -1,344 +0,0 @@ | |||
| 1 | From f20acf6fa22235fdaa551b0410d65627e028f4b4 Mon Sep 17 00:00:00 2001 | ||
| 2 | From: Ulf Hermann <ulf.hermann@qt.io> | ||
| 3 | Date: Fri, 27 Apr 2018 10:38:18 +0200 | ||
| 4 | Subject: [PATCH] Upgrade double-conversion to v3.0.0 | ||
| 5 | |||
| 6 | This fixes their issue #41, a potential undefined behavior. | ||
| 7 | |||
| 8 | We preserve the locally added "__ghs" clause as well as the _M_ARM_FP | ||
| 9 | clause necessary for winrt in utils.h. | ||
| 10 | |||
| 11 | [ChangeLog][Third-Party Code] double-conversion got updated to upstream | ||
| 12 | version 3.0.0. | ||
| 13 | |||
| 14 | Task-number: QTBUG-66561 | ||
| 15 | Change-Id: Id79125bdeeaebb61dca2e2885d3370accce9030c | ||
| 16 | Reviewed-by: Simon Hausmann <simon.hausmann@qt.io> | ||
| 17 | Upstream-Status: Backport | ||
| 18 | --- | ||
| 19 | src/3rdparty/double-conversion/bignum.cc | 2 +- | ||
| 20 | src/3rdparty/double-conversion/bignum.h | 1 - | ||
| 21 | .../double-conversion/cached-powers.cc | 5 +-- | ||
| 22 | src/3rdparty/double-conversion/diy-fp.h | 22 +++++------ | ||
| 23 | .../double-conversion/double-conversion.cc | 21 ++++++---- | ||
| 24 | src/3rdparty/double-conversion/fixed-dtoa.cc | 5 ++- | ||
| 25 | src/3rdparty/double-conversion/ieee.h | 2 +- | ||
| 26 | .../include/double-conversion/utils.h | 38 +++++++++++++------ | ||
| 27 | .../double-conversion/qt_attribution.json | 4 +- | ||
| 28 | src/3rdparty/double-conversion/strtod.cc | 2 +- | ||
| 29 | 10 files changed, 60 insertions(+), 42 deletions(-) | ||
| 30 | |||
| 31 | diff --git a/src/3rdparty/double-conversion/bignum.cc b/src/3rdparty/double-conversion/bignum.cc | ||
| 32 | index 2743d67e8d..8892de8f2a 100644 | ||
| 33 | --- a/src/3rdparty/double-conversion/bignum.cc | ||
| 34 | +++ b/src/3rdparty/double-conversion/bignum.cc | ||
| 35 | @@ -104,7 +104,7 @@ void Bignum::AssignDecimalString(Vector<const char> value) { | ||
| 36 | const int kMaxUint64DecimalDigits = 19; | ||
| 37 | Zero(); | ||
| 38 | int length = value.length(); | ||
| 39 | - int pos = 0; | ||
| 40 | + unsigned int pos = 0; | ||
| 41 | // Let's just say that each digit needs 4 bits. | ||
| 42 | while (length >= kMaxUint64DecimalDigits) { | ||
| 43 | uint64_t digits = ReadUInt64(value, pos, kMaxUint64DecimalDigits); | ||
| 44 | diff --git a/src/3rdparty/double-conversion/bignum.h b/src/3rdparty/double-conversion/bignum.h | ||
| 45 | index 5ec3544f57..c385f2237b 100644 | ||
| 46 | --- a/src/3rdparty/double-conversion/bignum.h | ||
| 47 | +++ b/src/3rdparty/double-conversion/bignum.h | ||
| 48 | @@ -49,7 +49,6 @@ class Bignum { | ||
| 49 | |||
| 50 | void AssignPowerUInt16(uint16_t base, int exponent); | ||
| 51 | |||
| 52 | - void AddUInt16(uint16_t operand); | ||
| 53 | void AddUInt64(uint64_t operand); | ||
| 54 | void AddBignum(const Bignum& other); | ||
| 55 | // Precondition: this >= other. | ||
| 56 | diff --git a/src/3rdparty/double-conversion/cached-powers.cc b/src/3rdparty/double-conversion/cached-powers.cc | ||
| 57 | index 9536f26927..2b43f06412 100644 | ||
| 58 | --- a/src/3rdparty/double-conversion/cached-powers.cc | ||
| 59 | +++ b/src/3rdparty/double-conversion/cached-powers.cc | ||
| 60 | @@ -131,7 +131,6 @@ static const CachedPower kCachedPowers[] = { | ||
| 61 | {UINT64_2PART_C(0xaf87023b, 9bf0ee6b), 1066, 340}, | ||
| 62 | }; | ||
| 63 | |||
| 64 | -static const int kCachedPowersLength = ARRAY_SIZE(kCachedPowers); | ||
| 65 | static const int kCachedPowersOffset = 348; // -1 * the first decimal_exponent. | ||
| 66 | static const double kD_1_LOG2_10 = 0.30102999566398114; // 1 / lg(10) | ||
| 67 | // Difference between the decimal exponents in the table above. | ||
| 68 | @@ -144,14 +143,12 @@ void PowersOfTenCache::GetCachedPowerForBinaryExponentRange( | ||
| 69 | int max_exponent, | ||
| 70 | DiyFp* power, | ||
| 71 | int* decimal_exponent) { | ||
| 72 | - (void)max_exponent; // Silence unused parameter warning in release builds | ||
| 73 | - (void)kCachedPowersLength; // Silence unused parameter warning in release builds | ||
| 74 | int kQ = DiyFp::kSignificandSize; | ||
| 75 | double k = ceil((min_exponent + kQ - 1) * kD_1_LOG2_10); | ||
| 76 | int foo = kCachedPowersOffset; | ||
| 77 | int index = | ||
| 78 | (foo + static_cast<int>(k) - 1) / kDecimalExponentDistance + 1; | ||
| 79 | - ASSERT(0 <= index && index < kCachedPowersLength); | ||
| 80 | + ASSERT(0 <= index && index < static_cast<int>(ARRAY_SIZE(kCachedPowers))); | ||
| 81 | CachedPower cached_power = kCachedPowers[index]; | ||
| 82 | ASSERT(min_exponent <= cached_power.binary_exponent); | ||
| 83 | (void) max_exponent; // Mark variable as used. | ||
| 84 | diff --git a/src/3rdparty/double-conversion/diy-fp.h b/src/3rdparty/double-conversion/diy-fp.h | ||
| 85 | index 9dcf8fbdba..2edf34674e 100644 | ||
| 86 | --- a/src/3rdparty/double-conversion/diy-fp.h | ||
| 87 | +++ b/src/3rdparty/double-conversion/diy-fp.h | ||
| 88 | @@ -42,7 +42,7 @@ class DiyFp { | ||
| 89 | static const int kSignificandSize = 64; | ||
| 90 | |||
| 91 | DiyFp() : f_(0), e_(0) {} | ||
| 92 | - DiyFp(uint64_t f, int e) : f_(f), e_(e) {} | ||
| 93 | + DiyFp(uint64_t significand, int exponent) : f_(significand), e_(exponent) {} | ||
| 94 | |||
| 95 | // this = this - other. | ||
| 96 | // The exponents of both numbers must be the same and the significand of this | ||
| 97 | @@ -76,22 +76,22 @@ class DiyFp { | ||
| 98 | |||
| 99 | void Normalize() { | ||
| 100 | ASSERT(f_ != 0); | ||
| 101 | - uint64_t f = f_; | ||
| 102 | - int e = e_; | ||
| 103 | + uint64_t significand = f_; | ||
| 104 | + int exponent = e_; | ||
| 105 | |||
| 106 | // This method is mainly called for normalizing boundaries. In general | ||
| 107 | // boundaries need to be shifted by 10 bits. We thus optimize for this case. | ||
| 108 | const uint64_t k10MSBits = UINT64_2PART_C(0xFFC00000, 00000000); | ||
| 109 | - while ((f & k10MSBits) == 0) { | ||
| 110 | - f <<= 10; | ||
| 111 | - e -= 10; | ||
| 112 | + while ((significand & k10MSBits) == 0) { | ||
| 113 | + significand <<= 10; | ||
| 114 | + exponent -= 10; | ||
| 115 | } | ||
| 116 | - while ((f & kUint64MSB) == 0) { | ||
| 117 | - f <<= 1; | ||
| 118 | - e--; | ||
| 119 | + while ((significand & kUint64MSB) == 0) { | ||
| 120 | + significand <<= 1; | ||
| 121 | + exponent--; | ||
| 122 | } | ||
| 123 | - f_ = f; | ||
| 124 | - e_ = e; | ||
| 125 | + f_ = significand; | ||
| 126 | + e_ = exponent; | ||
| 127 | } | ||
| 128 | |||
| 129 | static DiyFp Normalize(const DiyFp& a) { | ||
| 130 | diff --git a/src/3rdparty/double-conversion/double-conversion.cc b/src/3rdparty/double-conversion/double-conversion.cc | ||
| 131 | index 909985be82..6f21a0124c 100644 | ||
| 132 | --- a/src/3rdparty/double-conversion/double-conversion.cc | ||
| 133 | +++ b/src/3rdparty/double-conversion/double-conversion.cc | ||
| 134 | @@ -118,7 +118,7 @@ void DoubleToStringConverter::CreateDecimalRepresentation( | ||
| 135 | StringBuilder* result_builder) const { | ||
| 136 | // Create a representation that is padded with zeros if needed. | ||
| 137 | if (decimal_point <= 0) { | ||
| 138 | - // "0.00000decimal_rep". | ||
| 139 | + // "0.00000decimal_rep" or "0.000decimal_rep00". | ||
| 140 | result_builder->AddCharacter('0'); | ||
| 141 | if (digits_after_point > 0) { | ||
| 142 | result_builder->AddCharacter('.'); | ||
| 143 | @@ -129,7 +129,7 @@ void DoubleToStringConverter::CreateDecimalRepresentation( | ||
| 144 | result_builder->AddPadding('0', remaining_digits); | ||
| 145 | } | ||
| 146 | } else if (decimal_point >= length) { | ||
| 147 | - // "decimal_rep0000.00000" or "decimal_rep.0000" | ||
| 148 | + // "decimal_rep0000.00000" or "decimal_rep.0000". | ||
| 149 | result_builder->AddSubstring(decimal_digits, length); | ||
| 150 | result_builder->AddPadding('0', decimal_point - length); | ||
| 151 | if (digits_after_point > 0) { | ||
| 152 | @@ -137,7 +137,7 @@ void DoubleToStringConverter::CreateDecimalRepresentation( | ||
| 153 | result_builder->AddPadding('0', digits_after_point); | ||
| 154 | } | ||
| 155 | } else { | ||
| 156 | - // "decima.l_rep000" | ||
| 157 | + // "decima.l_rep000". | ||
| 158 | ASSERT(digits_after_point > 0); | ||
| 159 | result_builder->AddSubstring(decimal_digits, decimal_point); | ||
| 160 | result_builder->AddCharacter('.'); | ||
| 161 | @@ -494,10 +494,17 @@ static double SignedZero(bool sign) { | ||
| 162 | // because it constant-propagated the radix and concluded that the last | ||
| 163 | // condition was always true. By moving it into a separate function the | ||
| 164 | // compiler wouldn't warn anymore. | ||
| 165 | +#if _MSC_VER | ||
| 166 | +#pragma optimize("",off) | ||
| 167 | static bool IsDecimalDigitForRadix(int c, int radix) { | ||
| 168 | return '0' <= c && c <= '9' && (c - '0') < radix; | ||
| 169 | } | ||
| 170 | - | ||
| 171 | +#pragma optimize("",on) | ||
| 172 | +#else | ||
| 173 | +static bool inline IsDecimalDigitForRadix(int c, int radix) { | ||
| 174 | + return '0' <= c && c <= '9' && (c - '0') < radix; | ||
| 175 | +} | ||
| 176 | +#endif | ||
| 177 | // Returns true if 'c' is a character digit that is valid for the given radix. | ||
| 178 | // The 'a_character' should be 'a' or 'A'. | ||
| 179 | // | ||
| 180 | @@ -852,9 +859,9 @@ double StringToDoubleConverter::StringToIeee( | ||
| 181 | return junk_string_value_; | ||
| 182 | } | ||
| 183 | } | ||
| 184 | - char sign = '+'; | ||
| 185 | + char exponen_sign = '+'; | ||
| 186 | if (*current == '+' || *current == '-') { | ||
| 187 | - sign = static_cast<char>(*current); | ||
| 188 | + exponen_sign = static_cast<char>(*current); | ||
| 189 | ++current; | ||
| 190 | if (current == end) { | ||
| 191 | if (allow_trailing_junk) { | ||
| 192 | @@ -888,7 +895,7 @@ double StringToDoubleConverter::StringToIeee( | ||
| 193 | ++current; | ||
| 194 | } while (current != end && *current >= '0' && *current <= '9'); | ||
| 195 | |||
| 196 | - exponent += (sign == '-' ? -num : num); | ||
| 197 | + exponent += (exponen_sign == '-' ? -num : num); | ||
| 198 | } | ||
| 199 | |||
| 200 | if (!(allow_trailing_spaces || allow_trailing_junk) && (current != end)) { | ||
| 201 | diff --git a/src/3rdparty/double-conversion/fixed-dtoa.cc b/src/3rdparty/double-conversion/fixed-dtoa.cc | ||
| 202 | index aef65fdc21..0f55a0b6eb 100644 | ||
| 203 | --- a/src/3rdparty/double-conversion/fixed-dtoa.cc | ||
| 204 | +++ b/src/3rdparty/double-conversion/fixed-dtoa.cc | ||
| 205 | @@ -98,7 +98,7 @@ class UInt128 { | ||
| 206 | return high_bits_ == 0 && low_bits_ == 0; | ||
| 207 | } | ||
| 208 | |||
| 209 | - int BitAt(int position) { | ||
| 210 | + int BitAt(int position) const { | ||
| 211 | if (position >= 64) { | ||
| 212 | return static_cast<int>(high_bits_ >> (position - 64)) & 1; | ||
| 213 | } else { | ||
| 214 | @@ -259,7 +259,8 @@ static void FillFractionals(uint64_t fractionals, int exponent, | ||
| 215 | fractionals -= static_cast<uint64_t>(digit) << point; | ||
| 216 | } | ||
| 217 | // If the first bit after the point is set we have to round up. | ||
| 218 | - if (((fractionals >> (point - 1)) & 1) == 1) { | ||
| 219 | + ASSERT(fractionals == 0 || point - 1 >= 0); | ||
| 220 | + if ((fractionals != 0) && ((fractionals >> (point - 1)) & 1) == 1) { | ||
| 221 | RoundUp(buffer, length, decimal_point); | ||
| 222 | } | ||
| 223 | } else { // We need 128 bits. | ||
| 224 | diff --git a/src/3rdparty/double-conversion/ieee.h b/src/3rdparty/double-conversion/ieee.h | ||
| 225 | index 661141d1a8..b14cf4f717 100644 | ||
| 226 | --- a/src/3rdparty/double-conversion/ieee.h | ||
| 227 | +++ b/src/3rdparty/double-conversion/ieee.h | ||
| 228 | @@ -99,7 +99,7 @@ class Double { | ||
| 229 | } | ||
| 230 | |||
| 231 | double PreviousDouble() const { | ||
| 232 | - if (d64_ == (kInfinity | kSignMask)) return -Double::Infinity(); | ||
| 233 | + if (d64_ == (kInfinity | kSignMask)) return -Infinity(); | ||
| 234 | if (Sign() < 0) { | ||
| 235 | return Double(d64_ + 1).value(); | ||
| 236 | } else { | ||
| 237 | diff --git a/src/3rdparty/double-conversion/include/double-conversion/utils.h b/src/3rdparty/double-conversion/include/double-conversion/utils.h | ||
| 238 | index 20bfd36c84..ca7646d817 100644 | ||
| 239 | --- a/src/3rdparty/double-conversion/include/double-conversion/utils.h | ||
| 240 | +++ b/src/3rdparty/double-conversion/include/double-conversion/utils.h | ||
| 241 | @@ -33,19 +33,29 @@ | ||
| 242 | |||
| 243 | #include <assert.h> | ||
| 244 | #ifndef ASSERT | ||
| 245 | -# if defined(WINCE) || defined(_WIN32_WCE) | ||
| 246 | -# define ASSERT(condition) | ||
| 247 | -# else | ||
| 248 | -# define ASSERT(condition) \ | ||
| 249 | +#define ASSERT(condition) \ | ||
| 250 | assert(condition); | ||
| 251 | -# endif | ||
| 252 | #endif | ||
| 253 | #ifndef UNIMPLEMENTED | ||
| 254 | -# define UNIMPLEMENTED() (exit(-1)) | ||
| 255 | +#define UNIMPLEMENTED() (abort()) | ||
| 256 | +#endif | ||
| 257 | +#ifndef DOUBLE_CONVERSION_NO_RETURN | ||
| 258 | +#ifdef _MSC_VER | ||
| 259 | +#define DOUBLE_CONVERSION_NO_RETURN __declspec(noreturn) | ||
| 260 | +#else | ||
| 261 | +#define DOUBLE_CONVERSION_NO_RETURN __attribute__((noreturn)) | ||
| 262 | +#endif | ||
| 263 | #endif | ||
| 264 | #ifndef UNREACHABLE | ||
| 265 | -# define UNREACHABLE() (exit(-1)) | ||
| 266 | +#ifdef _MSC_VER | ||
| 267 | +void DOUBLE_CONVERSION_NO_RETURN abort_noreturn(); | ||
| 268 | +inline void abort_noreturn() { abort(); } | ||
| 269 | +#define UNREACHABLE() (abort_noreturn()) | ||
| 270 | +#else | ||
| 271 | +#define UNREACHABLE() (abort()) | ||
| 272 | #endif | ||
| 273 | +#endif | ||
| 274 | + | ||
| 275 | |||
| 276 | // Double operations detection based on target architecture. | ||
| 277 | // Linux uses a 80bit wide floating point stack on x86. This induces double | ||
| 278 | @@ -62,11 +72,15 @@ | ||
| 279 | defined(__hppa__) || defined(__ia64__) || \ | ||
| 280 | defined(__mips__) || \ | ||
| 281 | defined(__powerpc__) || defined(__ppc__) || defined(__ppc64__) || \ | ||
| 282 | + defined(_POWER) || defined(_ARCH_PPC) || defined(_ARCH_PPC64) || \ | ||
| 283 | defined(__sparc__) || defined(__sparc) || defined(__s390__) || \ | ||
| 284 | defined(__SH4__) || defined(__alpha__) || \ | ||
| 285 | defined(_MIPS_ARCH_MIPS32R2) || \ | ||
| 286 | - defined(__AARCH64EL__) | ||
| 287 | + defined(__AARCH64EL__) || defined(__aarch64__) || \ | ||
| 288 | + defined(__riscv) | ||
| 289 | #define DOUBLE_CONVERSION_CORRECT_DOUBLE_OPERATIONS 1 | ||
| 290 | +#elif defined(__mc68000__) | ||
| 291 | +#undef DOUBLE_CONVERSION_CORRECT_DOUBLE_OPERATIONS | ||
| 292 | #elif defined(_M_IX86) || defined(__i386__) || defined(__i386) | ||
| 293 | #if defined(_WIN32) | ||
| 294 | // Windows uses a 64bit wide floating point stack. | ||
| 295 | @@ -172,8 +186,8 @@ template <typename T> | ||
| 296 | class Vector { | ||
| 297 | public: | ||
| 298 | Vector() : start_(NULL), length_(0) {} | ||
| 299 | - Vector(T* data, int length) : start_(data), length_(length) { | ||
| 300 | - ASSERT(length == 0 || (length > 0 && data != NULL)); | ||
| 301 | + Vector(T* data, int len) : start_(data), length_(len) { | ||
| 302 | + ASSERT(len == 0 || (len > 0 && data != NULL)); | ||
| 303 | } | ||
| 304 | |||
| 305 | // Returns a vector using the same backing storage as this one, | ||
| 306 | @@ -215,8 +229,8 @@ class Vector { | ||
| 307 | // buffer bounds on all operations in debug mode. | ||
| 308 | class StringBuilder { | ||
| 309 | public: | ||
| 310 | - StringBuilder(char* buffer, int size) | ||
| 311 | - : buffer_(buffer, size), position_(0) { } | ||
| 312 | + StringBuilder(char* buffer, int buffer_size) | ||
| 313 | + : buffer_(buffer, buffer_size), position_(0) { } | ||
| 314 | |||
| 315 | ~StringBuilder() { if (!is_finalized()) Finalize(); } | ||
| 316 | |||
| 317 | diff --git a/src/3rdparty/double-conversion/qt_attribution.json b/src/3rdparty/double-conversion/qt_attribution.json | ||
| 318 | index 92118ac779..d41a7ef332 100644 | ||
| 319 | --- a/src/3rdparty/double-conversion/qt_attribution.json | ||
| 320 | +++ b/src/3rdparty/double-conversion/qt_attribution.json | ||
| 321 | @@ -5,8 +5,8 @@ | ||
| 322 | "QtUsage": "Used in Qt Core. Configure with -system-doubleconversion or -no-doubleconversion to avoid.", | ||
| 323 | |||
| 324 | "Homepage": "https://github.com/google/double-conversion", | ||
| 325 | - "Version": "2.0.1", | ||
| 326 | - "DownloadLocation": "https://github.com/google/double-conversion/commit/2fb03de56faa32bbba5e02222528e7b760f71d77", | ||
| 327 | + "Version": "3.0.0", | ||
| 328 | + "DownloadLocation": "https://github.com/google/double-conversion/commit/ca220cbafa83ca706f028bfbb5adc7eb2f1f90e1", | ||
| 329 | "License": "BSD 3-clause \"New\" or \"Revised\" License", | ||
| 330 | "LicenseId": "BSD-3-Clause", | ||
| 331 | "LicenseFile": "LICENSE", | ||
| 332 | diff --git a/src/3rdparty/double-conversion/strtod.cc b/src/3rdparty/double-conversion/strtod.cc | ||
| 333 | index 34717562bd..17abcbb2a5 100644 | ||
| 334 | --- a/src/3rdparty/double-conversion/strtod.cc | ||
| 335 | +++ b/src/3rdparty/double-conversion/strtod.cc | ||
| 336 | @@ -286,7 +286,7 @@ static bool DiyFpStrtod(Vector<const char> buffer, | ||
| 337 | const int kDenominator = 1 << kDenominatorLog; | ||
| 338 | // Move the remaining decimals into the exponent. | ||
| 339 | exponent += remaining_decimals; | ||
| 340 | - int error = (remaining_decimals == 0 ? 0 : kDenominator / 2); | ||
| 341 | + uint64_t error = (remaining_decimals == 0 ? 0 : kDenominator / 2); | ||
| 342 | |||
| 343 | int old_e = input.e(); | ||
| 344 | input.Normalize(); | ||
