Skip to content
Snippets Groups Projects
Commit 5214ac8d authored by Matt Morehouse's avatar Matt Morehouse
Browse files

[SanitizeCoverage] Enable stack-depth coverage for -fsanitize=fuzzer

Summary:
- Don't sanitize __sancov_lowest_stack.
- Don't instrument leaf functions.
- Add CoverageStackDepth to Fuzzer and FuzzerNoLink.
- Disable stack depth tracking on Mac.

Reviewers: vitalybuka, kcc, george.karpenkov

Reviewed By: kcc

Subscribers: kubamracek, cfe-commits, llvm-commits, hiraditya

Differential Revision: https://reviews.llvm.org/D37156

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@312026 91177308-0d34-0410-b5e6-96231b3b80d8
parent 6c16d90e
No related branches found
No related tags found
No related merge requests found
......@@ -291,9 +291,13 @@ SanitizerArgs::SanitizerArgs(const ToolChain &TC,
Add |= FuzzerNoLink;
// Enable coverage if the fuzzing flag is set.
if (Add & FuzzerNoLink)
if (Add & FuzzerNoLink) {
CoverageFeatures |= CoverageTracePCGuard | CoverageIndirCall |
CoverageTraceCmp | CoveragePCTable;
// Due to TLS differences, stack depth tracking is disabled on Mac.
if (!TC.getTriple().isOSDarwin())
CoverageFeatures |= CoverageStackDepth;
}
Kinds |= Add;
} else if (Arg->getOption().matches(options::OPT_fno_sanitize_EQ)) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment