[libc-commits] [PATCH] D157536: [libc] Fix printf %e and %g bugs

Michael Jones via Phabricator via libc-commits libc-commits at lists.llvm.org
Wed Aug 9 11:43:23 PDT 2023


michaelrj created this revision.
michaelrj added reviewers: sivachandra, lntue.
Herald added projects: libc-project, All.
Herald added a subscriber: libc-commits.
michaelrj requested review of this revision.

Fuzzing revealed bugs in the %e and %g conversions. Since these are very
similar, they are grouped together. Again, most of the bugs were related
to rounding. As an example, previously the code to check if the number
was truncated only worked for digits below the decimal point, due to it
being originally designed for %f. This patch adds a mechanism to check
the digits above the decimal point for both %e and %g.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D157536

Files:
  libc/src/stdio/printf_core/float_dec_converter.h
  libc/test/src/stdio/sprintf_test.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D157536.548715.patch
Type: text/x-patch
Size: 13268 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/libc-commits/attachments/20230809/77fc2ebd/attachment.bin>


More information about the libc-commits mailing list