Commit df008d4b authored by Michal Majewski's avatar Michal Majewski Committed by Commit Bot

[test] Set fuzzer seed to random seed by default

Bug: v8:6917
Change-Id: Iab4e9d7a8f8a4313a6722610fb6a2cfcff703d81
Reviewed-on: https://chromium-review.googlesource.com/866710Reviewed-by: 's avatarMichael Achenbach <machenbach@chromium.org>
Commit-Queue: Michał Majewski <majeski@google.com>
Cr-Commit-Position: refs/heads/master@{#50573}
parent 608437b4
......@@ -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")
......
......@@ -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) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment