diff --git a/compiler-rt/lib/fuzzer/FuzzerDriver.cpp b/compiler-rt/lib/fuzzer/FuzzerDriver.cpp --- a/compiler-rt/lib/fuzzer/FuzzerDriver.cpp +++ b/compiler-rt/lib/fuzzer/FuzzerDriver.cpp @@ -797,7 +797,7 @@ if (Flags.verbosity) Printf("INFO: Seed: %u\n", Seed); - if (Flags.collect_data_flow && !Flags.fork && + if (Flags.collect_data_flow && Flags.data_flow_trace && !Flags.fork && !(Flags.merge || Flags.set_cover_merge)) { if (RunIndividualFiles) return CollectDataFlow(Flags.collect_data_flow, Flags.data_flow_trace, diff --git a/compiler-rt/test/fuzzer/dataflow.test b/compiler-rt/test/fuzzer/dataflow.test --- a/compiler-rt/test/fuzzer/dataflow.test +++ b/compiler-rt/test/fuzzer/dataflow.test @@ -97,6 +97,11 @@ L20_FUZZM-NEXT: F2 00000000000000000001{{$}} L20_FUZZM-NOT: F +# Don't crash with missing data_flow args. +RUN: rm -rf %t-DFT +RUN: %t-ThreeFunctionsTest -collect_data_flow=%t-ThreeFunctionsTestDF +RUN: %t-ThreeFunctionsTest -data_flow_trace=%t-DFT %t/IN/FUZZMU + # Test libFuzzer's built in DFT collection. RUN: rm -rf %t-DFT RUN: %t-ThreeFunctionsTest -collect_data_flow=%t-ThreeFunctionsTestDF -data_flow_trace=%t-DFT %t/IN/FUZZMU