Factor out fuzzing disablement in the driver (#5048)

We end up needing to do this in any driver subcommand that reaches into
external code that may not be fully fuzz-clean. No need to grow multiple
different diagnostics for each, we can use a common diagnostic.
This commit is contained in:
Chandler Carruth
2025-03-03 16:14:06 +00:00
committed by GitHub
parent 87b9cab7b1
commit 437d3b9af6
8 changed files with 44 additions and 14 deletions
+1 -5
View File
@@ -93,11 +93,7 @@ auto LldSubcommand::Run(DriverEnv& driver_env) -> DriverResult {
// Don't run LLD when fuzzing, as we're not currently in a good position to
// debug and fix fuzzer-found bugs within LLD.
if (driver_env.fuzzing) {
CARBON_DIAGNOSTIC(
LLDFuzzingDisallowed, Error,
"preventing fuzzing of `lld` subcommand due to external library");
driver_env.emitter.Emit(LLDFuzzingDisallowed);
if (!DisableFuzzingExternalLibraries(driver_env, "lld")) {
return {.success = false};
}