| ... | @@ -325,18 +325,11 @@ extern fn fuzzer_next() FuzzerSlice; | ... | @@ -325,18 +325,11 @@ extern fn fuzzer_next() FuzzerSlice; |
| 325 | | 325 | |
| 326 | pub fn fuzzInput(options: testing.FuzzInputOptions) []const u8 { | 326 | pub fn fuzzInput(options: testing.FuzzInputOptions) []const u8 { |
| 327 | @disableInstrumentation(); | 327 | @disableInstrumentation(); |
| 328 | if (crippled) { | 328 | if (crippled) return ""; |
| 329 | return ""; | 329 | is_fuzz_test = true; |
| 330 | } else if (builtin.fuzz) { | 330 | if (builtin.fuzz) return fuzzer_next().toSlice(); |
| 331 | return fuzzer_next().toSlice(); | 331 | if (options.corpus.len == 0) return ""; |
| 332 | } else { | 332 | var prng = std.Random.DefaultPrng.init(testing.random_seed); |
| 333 | is_fuzz_test = true; | 333 | const random = prng.random(); |
| 334 | if (options.corpus.len == 0) { | 334 | return options.corpus[random.uintLessThan(usize, options.corpus.len)]; |
| 335 | return ""; | | |
| 336 | } else { | | |
| 337 | var prng = std.Random.DefaultPrng.init(testing.random_seed); | | |
| 338 | const random = prng.random(); | | |
| 339 | return options.corpus[random.uintLessThan(usize, options.corpus.len)]; | | |
| 340 | } | | |
| 341 | } | | |
| 342 | } | 335 | } |