[test] Set fuzzer seed to random seed by default

Bug: v8:6917
Change-Id: Iab4e9d7a8f8a4313a6722610fb6a2cfcff703d81
Reviewed-on: https://chromium-review.googlesource.com/866710
Reviewed-by: Michael Achenbach <machenbach@chromium.org>
Commit-Queue: Michał Majewski <majeski@google.com>
Cr-Commit-Position: refs/heads/master@{#50573}
This commit is contained in:
Michal Majewski 2018-01-15 12:08:36 +01:00 committed by Commit Bot
parent 608437b4fe
commit df008d4b84
2 changed files with 11 additions and 2 deletions

View File

@ -984,7 +984,7 @@ DEFINE_INT(random_seed, 0,
"(0, the default, means to use system random).")
DEFINE_INT(fuzzer_random_seed, 0,
"Default seed for initializing fuzzer random generator "
"(0, the default, means to use system random).")
"(0, the default, means to use v8's random number generator seed).")
DEFINE_BOOL(trace_rail, false, "trace RAIL mode")
DEFINE_BOOL(print_all_exceptions, false,
"print exception object and stack trace on each thrown exception")

View File

@ -3455,7 +3455,16 @@ base::RandomNumberGenerator* Isolate::random_number_generator() {
}
base::RandomNumberGenerator* Isolate::fuzzer_rng() {
return ensure_rng_exists(&fuzzer_rng_, FLAG_fuzzer_random_seed);
if (fuzzer_rng_ == nullptr) {
int64_t seed = FLAG_fuzzer_random_seed;
if (seed == 0) {
seed = random_number_generator()->initial_seed();
}
fuzzer_rng_ = new base::RandomNumberGenerator(seed);
}
return fuzzer_rng_;
}
int Isolate::GenerateIdentityHash(uint32_t mask) {