r312185 - [SanitizeCoverage] Enable stack-depth coverage for -fsanitize=fuzzer
Matt Morehouse via cfe-commits
cfe-commits at lists.llvm.org
Wed Aug 30 15:49:31 PDT 2017
Author: morehouse
Date: Wed Aug 30 15:49:31 2017
New Revision: 312185
URL: http://llvm.org/viewvc/llvm-project?rev=312185&view=rev
Log:
[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.
- Only enable on Linux.
Reviewers: vitalybuka, kcc, george.karpenkov
Reviewed By: kcc
Subscribers: kubamracek, cfe-commits, llvm-commits, hiraditya
Differential Revision: https://reviews.llvm.org/D37156
Modified:
cfe/trunk/lib/Driver/SanitizerArgs.cpp
Modified: cfe/trunk/lib/Driver/SanitizerArgs.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Driver/SanitizerArgs.cpp?rev=312185&r1=312184&r2=312185&view=diff
==============================================================================
--- cfe/trunk/lib/Driver/SanitizerArgs.cpp (original)
+++ cfe/trunk/lib/Driver/SanitizerArgs.cpp Wed Aug 30 15:49:31 2017
@@ -312,9 +312,13 @@ SanitizerArgs::SanitizerArgs(const ToolC
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 only enabled on Linux
+ if (TC.getTriple().isOSLinux())
+ CoverageFeatures |= CoverageStackDepth;
+ }
Kinds |= Add;
} else if (Arg->getOption().matches(options::OPT_fno_sanitize_EQ)) {
More information about the cfe-commits
mailing list