mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-10-06 06:44:46 +01:00
Exempt the clang subcommand when fuzzing. (#4468)
This teaches the driver library to track when its being used with fuzzing and disables the `clang` subcommand from actually running Clang. The Clang libraries have a large backlog of fuzzer-found issues that isn't being actively reduced, so we can't productively fuzz into it. This lets us more productively fuzz at the top level. This is also available on the command line itself, which should be useful if anyone wants to fuzz Carbon from the command line using tools like AFL -- they can inject this flag to avoid getting noise from the fuzzer hitting known issues in Clang.
This commit is contained in:
@@ -44,6 +44,15 @@ Arguments passed to Clang.
|
||||
auto ClangSubcommand::Run(DriverEnv& driver_env) -> DriverResult {
|
||||
std::string target = llvm::sys::getDefaultTargetTriple();
|
||||
ClangRunner runner(driver_env.installation, target, driver_env.vlog_stream);
|
||||
|
||||
// Don't run Clang when fuzzing, it is known to not be reliable under fuzzing
|
||||
// due to many unfixed issues.
|
||||
if (driver_env.fuzzing) {
|
||||
driver_env.error_stream
|
||||
<< "error: cannot run `clang` subcommand productively when fuzzing\n";
|
||||
return {.success = false};
|
||||
}
|
||||
|
||||
return {.success = runner.Run(options_.args)};
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user