DescriptionUse 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 #
Messages
Total messages: 15 (10 generated)
|