summaryrefslogtreecommitdiffstats
path: root/llvm/lib
diff options
context:
space:
mode:
authorDuncan P. N. Exon Smith <dexonsmith@apple.com>2015-03-20 18:48:45 +0000
committerDuncan P. N. Exon Smith <dexonsmith@apple.com>2015-03-20 18:48:45 +0000
commit18c97fa2a0b012c23c38fc67c3aca470398a2e26 (patch)
treeeebaf255082b6614e5f50dcfe8fe43810de24352 /llvm/lib
parent90aa1a96532b158e73df3d0ecbc0c138ae8cc2e5 (diff)
downloadbcm5719-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.cpp5
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;
OpenPOWER on IntegriCloud