[all-commits] [llvm/llvm-project] bf7f01: [libc] fix strtofloatingpoint on rare edge case

michaelrj-google via All-commits all-commits at lists.llvm.org
Mon Jul 18 14:23:45 PDT 2022


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: bf7f01d857eda2ea0753e92149c2941c7ad84bbc
      https://github.com/llvm/llvm-project/commit/bf7f01d857eda2ea0753e92149c2941c7ad84bbc
  Author: Michael Jones <michaelrj at google.com>
  Date:   2022-07-18 (Mon, 18 Jul 2022)

  Changed paths:
    M libc/src/__support/high_precision_decimal.h
    M libc/test/src/stdlib/strtod_test.cpp

  Log Message:
  -----------
  [libc] fix strtofloatingpoint on rare edge case

Currently, there are two string parsers that can be used in a call to
strtofloatingpoint. There is the main parser used by Clinger's fast path
and Eisel-Lemire, and the backup parser used by Simple Decimal
Conversion. There was a bug in the backup parser where if the number had
more than 800 digits (the size of the SDC buffer) before the decimal
point, it would just ignore the digits after the 800th and not count
them into the exponent. This patch fixes that issue and adds regression
tests.

Reviewed By: lntue

Differential Revision: https://reviews.llvm.org/D130032




More information about the All-commits mailing list