File tree Expand file tree Collapse file tree 6 files changed +12
-13
lines changed Expand file tree Collapse file tree 6 files changed +12
-13
lines changed Original file line number Diff line number Diff line change @@ -52,7 +52,7 @@ auto ClangSubcommand::Run(DriverEnv& driver_env) -> DriverResult {
52
52
53
53
// Don't run Clang when fuzzing, it is known to not be reliable under fuzzing
54
54
// due to many unfixed issues.
55
- if (! DisableFuzzingExternalLibraries (driver_env, " clang" )) {
55
+ if (TestAndDiagnoseIfFuzzingExternalLibraries (driver_env, " clang" )) {
56
56
return {.success = false };
57
57
}
58
58
Original file line number Diff line number Diff line change @@ -923,7 +923,7 @@ auto CompileSubcommand::Run(DriverEnv& driver_env) -> DriverResult {
923
923
if (driver_env.fuzzing && !options_.clang_args .empty ()) {
924
924
// Parsing specific Clang arguments can reach deep into
925
925
// external libraries that aren't fuzz clean.
926
- DisableFuzzingExternalLibraries (driver_env, " compile" );
926
+ TestAndDiagnoseIfFuzzingExternalLibraries (driver_env, " compile" );
927
927
return {.success = false };
928
928
}
929
929
for (auto str : options_.clang_args ) {
Original file line number Diff line number Diff line change 10
10
11
11
namespace Carbon {
12
12
13
- auto DriverSubcommand::DisableFuzzingExternalLibraries (DriverEnv& driver_env,
14
- llvm::StringRef name)
15
- -> bool {
13
+ auto DriverSubcommand::TestAndDiagnoseIfFuzzingExternalLibraries (
14
+ DriverEnv& driver_env, llvm::StringRef name) -> bool {
16
15
// Only need to do anything when fuzzing.
17
16
if (!driver_env.fuzzing ) {
18
- return true ;
17
+ return false ;
19
18
}
20
19
21
20
CARBON_DIAGNOSTIC (
22
21
ToolFuzzingDisallowed, Error,
23
22
" preventing fuzzing of `{0}` subcommand due to external library" ,
24
23
std::string);
25
24
driver_env.emitter .Emit (ToolFuzzingDisallowed, name.str ());
26
- return false ;
25
+ return true ;
27
26
}
28
27
29
28
} // namespace Carbon
Original file line number Diff line number Diff line change @@ -61,13 +61,13 @@ class DriverSubcommand {
61
61
virtual auto Run (DriverEnv& driver_env) -> DriverResult = 0;
62
62
63
63
protected:
64
- // Diagnoses and returns false if currently fuzzing .
64
+ // Tests if fuzzing and if so diagnose and returns true .
65
65
//
66
- // This should be used in subcommands to check and diagnose rather than
66
+ // This should be used in subcommands to diagnose and exit early rather than
67
67
// entering them during fuzzing when they use external libraries that we can't
68
68
// keep fuzz-clean.
69
- auto DisableFuzzingExternalLibraries (DriverEnv& driver_env,
70
- llvm::StringRef name) -> bool;
69
+ auto TestAndDiagnoseIfFuzzingExternalLibraries (DriverEnv& driver_env,
70
+ llvm::StringRef name) -> bool;
71
71
72
72
private:
73
73
// Subcommand information.
Original file line number Diff line number Diff line change @@ -95,7 +95,7 @@ auto LldSubcommand::Run(DriverEnv& driver_env) -> DriverResult {
95
95
96
96
// Don't run LLD when fuzzing, as we're not currently in a good position to
97
97
// debug and fix fuzzer-found bugs within LLD.
98
- if (! DisableFuzzingExternalLibraries (driver_env, " lld" )) {
98
+ if (TestAndDiagnoseIfFuzzingExternalLibraries (driver_env, " lld" )) {
99
99
return {.success = false };
100
100
}
101
101
Original file line number Diff line number Diff line change @@ -63,7 +63,7 @@ auto LLVMSubcommand::Run(DriverEnv& driver_env) -> DriverResult {
63
63
LLVMRunner runner (driver_env.installation , driver_env.vlog_stream );
64
64
65
65
// Don't run arbitrary LLVM tools and libraries when fuzzing.
66
- if (! DisableFuzzingExternalLibraries (driver_env, " llvm" )) {
66
+ if (TestAndDiagnoseIfFuzzingExternalLibraries (driver_env, " llvm" )) {
67
67
return {.success = false };
68
68
}
69
69
You can’t perform that action at this time.
0 commit comments