Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(219)

Issue 2588023002: Use a stricter limit for the exponent range in genericParseNumber (Closed)

Created:
4 years ago by fs
Modified:
4 years ago
Reviewers:
Stephen Chennney
CC:
fs, blink-reviews, chromium-reviews, krit, f(malita), gyuyoung2, kouhei+svg_chromium.org, pdr+svgwatchlist_chromium.org, rwlbuis, Stephen Chennney
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Use a stricter limit for the exponent range in genericParseNumber The exponent was being checked against numeric_limits<...>::max_exponent which is the power-of-two limit. Use max_exponent10 instead. Also make sure to apply any exponent sign prior to the range check so that min_exponent10 can be used as the lower bound. This means computing the base number before checking for/parsing the exponent part. This could be slower in some cases, but reasonably only when an error is encountered. Also, scientific notation should be fairly scarce to begin with. Also move declarations of local variables closer to their first use (and in the inner-most scope possible.) Unravel the handling of/accumulation into 'frac' when computing the decimal part. BUG=675174 Committed: https://crrev.com/57f9189c8edf1db60a0f4e1c3c4c7dbda6d47c6e Cr-Commit-Position: refs/heads/master@{#439522}

Patch Set 1 #

Unified diffs Side-by-side diffs Delta from patch set Stats (+27 lines, -24 lines) Patch
M third_party/WebKit/Source/core/svg/SVGParserUtilities.cpp View 6 chunks +27 lines, -24 lines 0 comments Download

Messages

Total messages: 15 (10 generated)
fs
4 years ago (2016-12-19 17:40:09 UTC) #5
Stephen Chennney
Thanks a lot for dealing with these over/underflow issues. lgtm
4 years ago (2016-12-19 18:21:08 UTC) #8
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2588023002/1
4 years ago (2016-12-19 19:27:25 UTC) #10
commit-bot: I haz the power
Committed patchset #1 (id:1)
4 years ago (2016-12-19 19:34:25 UTC) #13
commit-bot: I haz the power
4 years ago (2016-12-19 19:37:09 UTC) #15
Message was sent while issue was closed.
Patchset 1 (id:??) landed as
https://crrev.com/57f9189c8edf1db60a0f4e1c3c4c7dbda6d47c6e
Cr-Commit-Position: refs/heads/master@{#439522}

Powered by Google App Engine
This is Rietveld 408576698