forked from Pissandshittium/pissandshittium
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix parsing of exponents in StringToDouble.
BUG=542881 Review-Url: https://codereview.chromium.org/2296503003 Cr-Commit-Position: refs/heads/master@{#416158}
- Loading branch information
Showing
4 changed files
with
57 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
diff --git a/base/third_party/dmg_fp/dtoa.cc b/base/third_party/dmg_fp/dtoa.cc | ||
index 502c16c..f3d793e 100644 | ||
--- a/base/third_party/dmg_fp/dtoa.cc | ||
+++ b/base/third_party/dmg_fp/dtoa.cc | ||
@@ -2597,8 +2597,11 @@ strtod | ||
if (c > '0' && c <= '9') { | ||
L = c - '0'; | ||
s1 = s; | ||
- while((c = *++s) >= '0' && c <= '9') | ||
+ while((c = *++s) >= '0' && c <= '9') { | ||
L = 10*L + c - '0'; | ||
+ if (L > DBL_MAX_10_EXP) | ||
+ break; | ||
+ } | ||
if (s - s1 > 8 || L > 19999) | ||
/* Avoid confusion from exponents | ||
* so large that e might overflow. |