[PATCH] D63553: [libFuzzer] Remove too aggressive static_assert in FuzzedDataProvider.

Max Moroz via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Jun 19 07:11:37 PDT 2019


Dor1s created this revision.
Herald added subscribers: llvm-commits, Sanitizers, delcypher, kristof.beyls, javed.absar.
Herald added projects: LLVM, Sanitizers.
Dor1s accepted this revision.
Dor1s added a comment.
This revision is now accepted and ready to land.

Self-approval for a minor fix.


http://lab.llvm.org:8011/builders/clang-cmake-aarch64-full/builds/31

error: static_assert failed due to requirement
'std::numeric_limits<char>::is_signed' "Destination type must be
signed."

  static_assert(std::numeric_limits<TS>::is_signed,
  ^             ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

/home/buildslave/buildslave/clang-cmake-aarch64-full/llvm/projects/compiler-rt/lib/fuzzer/utils/FuzzedDataProvider.h:126:19:
note: in instantiation of function template specialization
'FuzzedDataProvider::ConvertUnsignedToSigned<char, unsigned char>'
requested here

  char next = ConvertUnsignedToSigned<char>(data_ptr_[0]);
              ^

1 error generated.


Repository:
  rCRT Compiler Runtime

https://reviews.llvm.org/D63553

Files:
  lib/fuzzer/utils/FuzzedDataProvider.h


Index: lib/fuzzer/utils/FuzzedDataProvider.h
===================================================================
--- lib/fuzzer/utils/FuzzedDataProvider.h
+++ lib/fuzzer/utils/FuzzedDataProvider.h
@@ -223,8 +223,6 @@
     static_assert(sizeof(TS) == sizeof(TU), "Incompatible data types.");
     static_assert(!std::numeric_limits<TU>::is_signed,
                   "Source type must be unsigned.");
-    static_assert(std::numeric_limits<TS>::is_signed,
-                  "Destination type must be signed.");
 
     // TODO(Dor1s): change to `if constexpr` once C++17 becomes mainstream.
     if (std::numeric_limits<TS>::is_modulo)


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D63553.205580.patch
Type: text/x-patch
Size: 635 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20190619/e017d84b/attachment.bin>


More information about the llvm-commits mailing list