summaryrefslogtreecommitdiffstats
path: root/base
diff options
context:
space:
mode:
authortony@chromium.org <tony@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-05-15 00:00:26 +0000
committertony@chromium.org <tony@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-05-15 00:00:26 +0000
commitd41811ae999e8b7e02b0392f8c725ac597b8d540 (patch)
tree7e6d56f0edcd8761f3bc72ecdfcf265564db257d /base
parent612ee494b34f46ecb67080025258152dca8ff165 (diff)
downloadchromium_src-d41811ae999e8b7e02b0392f8c725ac597b8d540.zip
chromium_src-d41811ae999e8b7e02b0392f8c725ac597b8d540.tar.gz
chromium_src-d41811ae999e8b7e02b0392f8c725ac597b8d540.tar.bz2
Speculative fix for a crash in dtoa.
This is a patch that FireFox has had for > 5 years. This is just a guess based on where the crash is happening. BUG=123157 TEST=Covered by exising unit tests. Review URL: https://chromiumcodereview.appspot.com/10332147 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@137020 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'base')
-rw-r--r--base/third_party/dmg_fp/README.chromium2
-rw-r--r--base/third_party/dmg_fp/dtoa.cc2
-rw-r--r--base/third_party/dmg_fp/float_precision_crash.patch13
3 files changed, 16 insertions, 1 deletions
diff --git a/base/third_party/dmg_fp/README.chromium b/base/third_party/dmg_fp/README.chromium
index f52c96a..423946e 100644
--- a/base/third_party/dmg_fp/README.chromium
+++ b/base/third_party/dmg_fp/README.chromium
@@ -14,3 +14,5 @@ List of changes made to original code:
gcc_warnings.patch.
- made some minor changes to build on 64-bit, see gcc_64_bit.patch.
- made minor changes for -Wextra for Mac build, see mac_wextra.patch
+ - crash fix for running with reduced CPU float precision, see
+ float_precision_crash.patch and crbug.com/123157
diff --git a/base/third_party/dmg_fp/dtoa.cc b/base/third_party/dmg_fp/dtoa.cc
index 3f7e794..3312fa4 100644
--- a/base/third_party/dmg_fp/dtoa.cc
+++ b/base/third_party/dmg_fp/dtoa.cc
@@ -3891,7 +3891,7 @@ dtoa
goto no_digits;
goto one_digit;
}
- for(i = 1;; i++, dval(&u) *= 10.) {
+ for(i = 1; i <= k + 1; i++, dval(&u) *= 10.) {
L = (Long)(dval(&u) / ds);
dval(&u) -= L*ds;
#ifdef Check_FLT_ROUNDS
diff --git a/base/third_party/dmg_fp/float_precision_crash.patch b/base/third_party/dmg_fp/float_precision_crash.patch
new file mode 100644
index 0000000..df64e7e
--- /dev/null
+++ b/base/third_party/dmg_fp/float_precision_crash.patch
@@ -0,0 +1,13 @@
+diff --git a/base/third_party/dmg_fp/dtoa.cc b/base/third_party/dmg_fp/dtoa.cc
+index 3f7e794..3312fa4 100644
+--- dtoa.cc
++++ dtoa.cc
+@@ -3891,7 +3891,7 @@ dtoa
+ goto no_digits;
+ goto one_digit;
+ }
+- for(i = 1;; i++, dval(&u) *= 10.) {
++ for(i = 1; i <= k + 1; i++, dval(&u) *= 10.) {
+ L = (Long)(dval(&u) / ds);
+ dval(&u) -= L*ds;
+ #ifdef Check_FLT_ROUNDS