Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 11 additions & 2 deletions scripts/clusterfuzz/run.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,12 @@

# The V8 flags we put in the "fuzzer flags" files, which tell ClusterFuzz how to
# run V8. By default we apply all staging flags.
FUZZER_FLAGS_FILE_CONTENTS = '--wasm-staging'
FUZZER_FLAGS = '--wasm-staging'

# Optional V8 flags to add to FUZZER_FLAGS, some of the time.
OPTIONAL_FUZZER_FLAGS = [
'--experimental-wasm-revectorize',
]

# Maximum size of the random data that we feed into wasm-opt -ttf. This is
# smaller than fuzz_opt.py's INPUT_SIZE_MAX because that script is tuned for
Expand Down Expand Up @@ -292,7 +297,11 @@ def main(argv):
flags_file_path = os.path.join(output_dir,
get_file_name(FLAGS_FILENAME_PREFIX, i))
with open(flags_file_path, 'w') as file:
file.write(FUZZER_FLAGS_FILE_CONTENTS)
flags = FUZZER_FLAGS
# Some of the time add an additional flag for V8.
if OPTIONAL_FUZZER_FLAGS and system_random.random() < 0.5:
flags += ' ' + system_random.choice(OPTIONAL_FUZZER_FLAGS)
file.write(flags)

print(f'Created testcase: {testcase_file_path}')

Expand Down
2 changes: 1 addition & 1 deletion test/unit/test_cluster_fuzz.py
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ def test_file_contents(self):

# The flags file must contain --wasm-staging
with open(flags_file) as f:
self.assertEqual(f.read(), '--wasm-staging')
self.assertIn('--wasm-staging', f.read())

# Extract the wasm file(s) from the JS. Make sure to not notice
# stale files.
Expand Down
Loading