diff options
author | Duncan P. N. Exon Smith <dexonsmith@apple.com> | 2015-03-20 18:48:45 +0000 |
---|---|---|
committer | Duncan P. N. Exon Smith <dexonsmith@apple.com> | 2015-03-20 18:48:45 +0000 |
commit | 18c97fa2a0b012c23c38fc67c3aca470398a2e26 (patch) | |
tree | eebaf255082b6614e5f50dcfe8fe43810de24352 /llvm/lib | |
parent | 90aa1a96532b158e73df3d0ecbc0c138ae8cc2e5 (diff) | |
download | bcm5719-llvm-18c97fa2a0b012c23c38fc67c3aca470398a2e26.tar.gz bcm5719-llvm-18c97fa2a0b012c23c38fc67c3aca470398a2e26.zip |
SanitizerCoverage: Check for null DebugLocs
After a WIP patch to make `DIDescriptor` accessors more strict, this
started asserting.
llvm-svn: 232832
Diffstat (limited to 'llvm/lib')
-rw-r--r-- | llvm/lib/Transforms/Instrumentation/SanitizerCoverage.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/llvm/lib/Transforms/Instrumentation/SanitizerCoverage.cpp b/llvm/lib/Transforms/Instrumentation/SanitizerCoverage.cpp index 9c74b5ea5c2..9f534e4f51d 100644 --- a/llvm/lib/Transforms/Instrumentation/SanitizerCoverage.cpp +++ b/llvm/lib/Transforms/Instrumentation/SanitizerCoverage.cpp @@ -329,8 +329,9 @@ void SanitizerCoverageModule::InjectCoverageAtBlock(Function &F, BasicBlock &BB, } bool IsEntryBB = &BB == &F.getEntryBlock(); - DebugLoc EntryLoc = - IsEntryBB ? IP->getDebugLoc().getFnDebugLoc(*C) : IP->getDebugLoc(); + DebugLoc EntryLoc = IsEntryBB && !IP->getDebugLoc().isUnknown() + ? IP->getDebugLoc().getFnDebugLoc(*C) + : IP->getDebugLoc(); IRBuilder<> IRB(IP); IRB.SetCurrentDebugLocation(EntryLoc); SmallVector<Value *, 1> Indices; |