diff options
author | Kostya Serebryany <kcc@google.com> | 2017-08-01 00:44:05 +0000 |
---|---|---|
committer | Kostya Serebryany <kcc@google.com> | 2017-08-01 00:44:05 +0000 |
commit | a1f12ba17e94aad4ddb904385aeae124f4586a26 (patch) | |
tree | 12276e4fa1af2fffe32dad76fee25274671204d4 /llvm/lib | |
parent | 05a04cbeddd022b2387ab016704fcabb37d3c811 (diff) | |
download | bcm5719-llvm-a1f12ba17e94aad4ddb904385aeae124f4586a26.tar.gz bcm5719-llvm-a1f12ba17e94aad4ddb904385aeae124f4586a26.zip |
[sanitizer-coverage] relax an assertion
llvm-svn: 309644
Diffstat (limited to 'llvm/lib')
-rw-r--r-- | llvm/lib/Transforms/Instrumentation/SanitizerCoverage.cpp | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/llvm/lib/Transforms/Instrumentation/SanitizerCoverage.cpp b/llvm/lib/Transforms/Instrumentation/SanitizerCoverage.cpp index 1b6d6d6f3c6..767c2b03e18 100644 --- a/llvm/lib/Transforms/Instrumentation/SanitizerCoverage.cpp +++ b/llvm/lib/Transforms/Instrumentation/SanitizerCoverage.cpp @@ -499,12 +499,13 @@ void SanitizerCoverageModule::CreatePCArray(Function &F, ArrayRef<BasicBlock *> AllBlocks) { size_t N = AllBlocks.size(); assert(N); - assert(&F.getEntryBlock() == AllBlocks[0]); SmallVector<Constant *, 16> PCs; IRBuilder<> IRB(&*F.getEntryBlock().getFirstInsertionPt()); - PCs.push_back((Constant *)IRB.CreatePointerCast(&F, Int8PtrTy)); - for (size_t i = 1; i < N; i++) - PCs.push_back(BlockAddress::get(AllBlocks[i])); + for (size_t i = 0; i < N; i++) + if (&F.getEntryBlock() == AllBlocks[i]) + PCs.push_back((Constant *)IRB.CreatePointerCast(&F, Int8PtrTy)); + else + PCs.push_back(BlockAddress::get(AllBlocks[i])); FunctionPCsArray = CreateFunctionLocalArrayInSection(N, F, Int8PtrTy, SanCovPCsSectionName); FunctionPCsArray->setInitializer( |