File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 3333
3434# The V8 flags we put in the "fuzzer flags" files, which tell ClusterFuzz how to
3535# run V8. By default we apply all staging flags.
36- FUZZER_FLAGS_FILE_CONTENTS = '--wasm-staging'
36+ FUZZER_FLAGS = '--wasm-staging'
37+
38+ # Optional V8 flags to add to FUZZER_FLAGS, some of the time.
39+ OPTIONAL_FUZZER_FLAGS = [
40+ '--experimental-wasm-revectorize' ,
41+ ]
3742
3843# Maximum size of the random data that we feed into wasm-opt -ttf. This is
3944# smaller than fuzz_opt.py's INPUT_SIZE_MAX because that script is tuned for
@@ -292,7 +297,11 @@ def main(argv):
292297 flags_file_path = os .path .join (output_dir ,
293298 get_file_name (FLAGS_FILENAME_PREFIX , i ))
294299 with open (flags_file_path , 'w' ) as file :
295- file .write (FUZZER_FLAGS_FILE_CONTENTS )
300+ flags = FUZZER_FLAGS
301+ # Some of the time add an additional flag for V8.
302+ if OPTIONAL_FUZZER_FLAGS and system_random .random () < 0.5 :
303+ flags += ' ' + system_random .choice (OPTIONAL_FUZZER_FLAGS )
304+ file .write (flags )
296305
297306 print (f'Created testcase: { testcase_file_path } ' )
298307
Original file line number Diff line number Diff line change @@ -186,7 +186,7 @@ def test_file_contents(self):
186186
187187 # The flags file must contain --wasm-staging
188188 with open (flags_file ) as f :
189- self .assertEqual ( f . read (), '--wasm-staging' )
189+ self .assertIn ( '--wasm-staging' , f . read () )
190190
191191 # Extract the wasm file(s) from the JS. Make sure to not notice
192192 # stale files.
You can’t perform that action at this time.
0 commit comments