[llvm] r290622 - [libFuzzer] fix UB and simplify the computation of the RNG seed (https://llvm.org/bugs/show_bug.cgi?id=31456)
Kostya Serebryany via llvm-commits
llvm-commits at lists.llvm.org
Tue Dec 27 11:51:34 PST 2016
Author: kcc
Date: Tue Dec 27 13:51:34 2016
New Revision: 290622
URL: http://llvm.org/viewvc/llvm-project?rev=290622&view=rev
Log:
[libFuzzer] fix UB and simplify the computation of the RNG seed (https://llvm.org/bugs/show_bug.cgi?id=31456)
Modified:
llvm/trunk/lib/Fuzzer/FuzzerDriver.cpp
Modified: llvm/trunk/lib/Fuzzer/FuzzerDriver.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Fuzzer/FuzzerDriver.cpp?rev=290622&r1=290621&r2=290622&view=diff
==============================================================================
--- llvm/trunk/lib/Fuzzer/FuzzerDriver.cpp (original)
+++ llvm/trunk/lib/Fuzzer/FuzzerDriver.cpp Tue Dec 27 13:51:34 2016
@@ -442,8 +442,8 @@ int FuzzerDriver(int *argc, char ***argv
unsigned Seed = Flags.seed;
// Initialize Seed.
if (Seed == 0)
- Seed = (std::chrono::system_clock::now().time_since_epoch().count() << 10) +
- GetPid();
+ Seed =
+ std::chrono::system_clock::now().time_since_epoch().count() + GetPid();
if (Flags.verbosity)
Printf("INFO: Seed: %u\n", Seed);
More information about the llvm-commits
mailing list