diff options
Diffstat (limited to '')
-rw-r--r-- | security/sandbox/chromium-shim/patches/with_update/remove_unused_functions_from_StrtodTrimmed.patch | 48 |
1 files changed, 48 insertions, 0 deletions
diff --git a/security/sandbox/chromium-shim/patches/with_update/remove_unused_functions_from_StrtodTrimmed.patch b/security/sandbox/chromium-shim/patches/with_update/remove_unused_functions_from_StrtodTrimmed.patch new file mode 100644 index 0000000000..a097360ac5 --- /dev/null +++ b/security/sandbox/chromium-shim/patches/with_update/remove_unused_functions_from_StrtodTrimmed.patch @@ -0,0 +1,48 @@ +# HG changeset patch +# User Toshihito Kikuchi <tkikuchi@mozilla.com> +# Date 1588733379 25200 +# Tue May 05 19:49:39 2020 -0700 +# Node ID 044c15e89ecca19afc1750c439f4e82879679462 +# Parent a18431660425e41c26c716413aac0294987c985a +Remove unused functions from //base/third_party/double_conversion/double-conversion to compile. r=bobowen + +diff --git a/security/sandbox/chromium/base/third_party/double_conversion/double-conversion/strtod.cc b/security/sandbox/chromium/base/third_party/double_conversion/double-conversion/strtod.cc +--- a/security/sandbox/chromium/base/third_party/double_conversion/double-conversion/strtod.cc ++++ b/security/sandbox/chromium/base/third_party/double_conversion/double-conversion/strtod.cc +@@ -445,36 +445,18 @@ static bool ComputeGuess(Vector<const ch + return true; + } + if (*guess == Double::Infinity()) { + return true; + } + return false; + } + +-static bool IsDigit(const char d) { +- return ('0' <= d) && (d <= '9'); +-} +- +-static bool IsNonZeroDigit(const char d) { +- return ('1' <= d) && (d <= '9'); +-} +- +-static bool AssertTrimmedDigits(const Vector<const char>& buffer) { +- for(int i = 0; i < buffer.length(); ++i) { +- if(!IsDigit(buffer[i])) { +- return false; +- } +- } +- return (buffer.length() == 0) || (IsNonZeroDigit(buffer[0]) && IsNonZeroDigit(buffer[buffer.length()-1])); +-} +- + double StrtodTrimmed(Vector<const char> trimmed, int exponent) { + DOUBLE_CONVERSION_ASSERT(trimmed.length() <= kMaxSignificantDecimalDigits); +- DOUBLE_CONVERSION_ASSERT(AssertTrimmedDigits(trimmed)); + double guess; + const bool is_correct = ComputeGuess(trimmed, exponent, &guess); + if (is_correct) { + return guess; + } + DiyFp upper_boundary = Double(guess).UpperBoundary(); + int comparison = CompareBufferWithDiyFp(trimmed, exponent, upper_boundary); + if (comparison < 0) { |