[libc-commits] [PATCH] D149359: [libc] add exception to atof differential fuzz

Siva Chandra via Phabricator via libc-commits libc-commits at lists.llvm.org
Thu Apr 27 23:42:57 PDT 2023


sivachandra added inline comments.


================
Comment at: libc/fuzzing/stdlib/atof_differential_fuzz.cpp:22
+#define LLVM_LIBC_FUZZER_GLIBC_HEX_SUBNORMAL_ERR
+#ifdef LLVM_LIBC_FUZZER_GLIBC_HEX_SUBNORMAL_ERR
+#include <ctype.h>
----------------
A normal way to do this would be to:

```
#ifdef LLVM_LIBC_...
...
#else
...
#endif
```

And, let users define that macro in the build system. Also, the name of the macro can be more suggestive I think: `LLVM_LIBC_ATOF_DIF_FUZZ_SKIP_GLIBC_HEX_SUBNORMAL_ERR`.


================
Comment at: libc/fuzzing/stdlib/atof_differential_fuzz.cpp:55
 extern "C" int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {
   uint8_t *container = new uint8_t[size + 1];
   if (!container)
----------------
If the skip check function can take the size argument, can we skip before making the copy.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D149359/new/

https://reviews.llvm.org/D149359



More information about the libc-commits mailing list