summaryrefslogtreecommitdiffstats
path: root/llvm/lib
diff options
context:
space:
mode:
authorReid Kleckner <rnk@google.com>2016-11-11 19:18:45 +0000
committerReid Kleckner <rnk@google.com>2016-11-11 19:18:45 +0000
commitec80354873dab4a4b0263724f357b022bc19880a (patch)
treed7b7450fdb18f9f763555947e845934ee084f155 /llvm/lib
parentbfb371a083577b5d37e1d2918e80cae06831a634 (diff)
downloadbcm5719-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.cpp5
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.
OpenPOWER on IntegriCloud