diff options
author | Reid Kleckner <rnk@google.com> | 2016-11-11 19:18:45 +0000 |
---|---|---|
committer | Reid Kleckner <rnk@google.com> | 2016-11-11 19:18:45 +0000 |
commit | ec80354873dab4a4b0263724f357b022bc19880a (patch) | |
tree | d7b7450fdb18f9f763555947e845934ee084f155 /llvm/lib | |
parent | bfb371a083577b5d37e1d2918e80cae06831a634 (diff) | |
download | bcm5719-llvm-ec80354873dab4a4b0263724f357b022bc19880a.tar.gz bcm5719-llvm-ec80354873dab4a4b0263724f357b022bc19880a.zip |
[sancov] Don't instrument MSVC CRT stdio config helpers
They get called before initialization, which is a problem for winasan.
Test coming in compiler-rt.
llvm-svn: 286615
Diffstat (limited to 'llvm/lib')
-rw-r--r-- | llvm/lib/Transforms/Instrumentation/SanitizerCoverage.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/llvm/lib/Transforms/Instrumentation/SanitizerCoverage.cpp b/llvm/lib/Transforms/Instrumentation/SanitizerCoverage.cpp index 93ca8668eaf..73881fa93ac 100644 --- a/llvm/lib/Transforms/Instrumentation/SanitizerCoverage.cpp +++ b/llvm/lib/Transforms/Instrumentation/SanitizerCoverage.cpp @@ -448,6 +448,11 @@ bool SanitizerCoverageModule::runOnFunction(Function &F) { return false; // Should not instrument sanitizer init functions. if (F.getName().startswith("__sanitizer_")) return false; // Don't instrument __sanitizer_* callbacks. + // Don't instrument MSVC CRT configuration helpers. They may run before normal + // initialization. + if (F.getName() == "__local_stdio_printf_options" || + F.getName() == "__local_stdio_scanf_options") + return false; // Don't instrument functions using SEH for now. Splitting basic blocks like // we do for coverage breaks WinEHPrepare. // FIXME: Remove this when SEH no longer uses landingpad pattern matching. |