summaryrefslogtreecommitdiffstats
path: root/llvm/lib
diff options
context:
space:
mode:
authorKostya Serebryany <kcc@google.com>2016-07-14 17:59:01 +0000
committerKostya Serebryany <kcc@google.com>2016-07-14 17:59:01 +0000
commitdd5c7f9313ca9b1ec9c4f49c1af03d2835f02ac1 (patch)
treeed02dddd8fb00dc81d5ed04b0a730f1a5829a629 /llvm/lib
parentcb7d6e955d74fc58b1a537023aef0f566d412c42 (diff)
downloadbcm5719-llvm-dd5c7f9313ca9b1ec9c4f49c1af03d2835f02ac1.tar.gz
bcm5719-llvm-dd5c7f9313ca9b1ec9c4f49c1af03d2835f02ac1.zip
[sanitizer-coverage] make sure that calls to __sanitizer_cov_trace_pc are not merged (otherwise different calls get the same PC and confuse fuzzers)
llvm-svn: 275449
Diffstat (limited to 'llvm/lib')
-rw-r--r--llvm/lib/Transforms/Instrumentation/SanitizerCoverage.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/llvm/lib/Transforms/Instrumentation/SanitizerCoverage.cpp b/llvm/lib/Transforms/Instrumentation/SanitizerCoverage.cpp
index 1315e19732f..7d404473655 100644
--- a/llvm/lib/Transforms/Instrumentation/SanitizerCoverage.cpp
+++ b/llvm/lib/Transforms/Instrumentation/SanitizerCoverage.cpp
@@ -544,7 +544,8 @@ void SanitizerCoverageModule::InjectCoverageAtBlock(Function &F, BasicBlock &BB,
Type *Int32PtrTy = PointerType::getUnqual(IRB.getInt32Ty());
GuardP = IRB.CreateIntToPtr(GuardP, Int32PtrTy);
if (Options.TracePC) {
- IRB.CreateCall(SanCovTracePC);
+ IRB.CreateCall(SanCovTracePC); // gets the PC using GET_CALLER_PC.
+ IRB.CreateCall(EmptyAsm, {}); // Avoids callback merge.
} else if (Options.TraceBB) {
IRB.CreateCall(IsEntryBB ? SanCovTraceEnter : SanCovTraceBB, GuardP);
} else if (UseCalls) {
OpenPOWER on IntegriCloud