This is an archive of the discontinued LLVM Phabricator instance.

[libc] Fix strtod exponent overflow bug
ClosedPublic

Authored by michaelrj on Apr 12 2023, 11:32 AM.

Details

Summary

String to float has a condition to prevent overflowing the exponent with
the E notation. To do this it checks if adding that exponent to the
exponent found by parsing the number is greater than the maximum
exponent for the given size of float. The if statements had a gap on
exactly the maximum exponent value that caused it to be treated as the
minimum exponent value. This patch fixes those conditions.

Diff Detail

Event Timeline

michaelrj created this revision.Apr 12 2023, 11:32 AM
Herald added projects: Restricted Project, Restricted Project. · View Herald TranscriptApr 12 2023, 11:32 AM
michaelrj requested review of this revision.Apr 12 2023, 11:32 AM
lntue accepted this revision.Apr 12 2023, 1:11 PM
This revision is now accepted and ready to land.Apr 12 2023, 1:11 PM
This revision was automatically updated to reflect the committed changes.