[compiler-rt] r352747 - Revert r352732: [libFuzzer] replace slow std::mt19937 with a much faster std::minstd_rand

Jeremy Morse via llvm-commits llvm-commits at lists.llvm.org
Thu Jan 31 04:44:14 PST 2019


Author: jmorse
Date: Thu Jan 31 04:44:14 2019
New Revision: 352747

URL: http://llvm.org/viewvc/llvm-project?rev=352747&view=rev
Log:
Revert r352732: [libFuzzer] replace slow std::mt19937 with a much faster std::minstd_rand

This causes a failure on the following bot as well as our internal ones:

http://lab.llvm.org:8011/builders/sanitizer-x86_64-linux-fuzzer/builds/23103

Modified:
    compiler-rt/trunk/lib/fuzzer/FuzzerRandom.h

Modified: compiler-rt/trunk/lib/fuzzer/FuzzerRandom.h
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/fuzzer/FuzzerRandom.h?rev=352747&r1=352746&r2=352747&view=diff
==============================================================================
--- compiler-rt/trunk/lib/fuzzer/FuzzerRandom.h (original)
+++ compiler-rt/trunk/lib/fuzzer/FuzzerRandom.h Thu Jan 31 04:44:14 2019
@@ -14,10 +14,10 @@
 #include <random>
 
 namespace fuzzer {
-class Random : public std::minstd_rand {
+class Random : public std::mt19937 {
  public:
-  Random(unsigned int seed) : std::minstd_rand(seed) {}
-  result_type operator()() { return this->std::minstd_rand::operator()(); }
+  Random(unsigned int seed) : std::mt19937(seed) {}
+  result_type operator()() { return this->std::mt19937::operator()(); }
   size_t Rand() { return this->operator()(); }
   size_t RandBool() { return Rand() % 2; }
   size_t operator()(size_t n) { return n ? Rand() % n : 0; }




More information about the llvm-commits mailing list