From: Duncan P. N. Exon Smith Date: Fri, 20 Mar 2015 18:48:45 +0000 (+0000) Subject: SanitizerCoverage: Check for null DebugLocs X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=14d8dbd37d06d880f010662613d501ec32c4c121;p=oota-llvm.git SanitizerCoverage: Check for null DebugLocs After a WIP patch to make `DIDescriptor` accessors more strict, this started asserting. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@232832 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/Transforms/Instrumentation/SanitizerCoverage.cpp b/lib/Transforms/Instrumentation/SanitizerCoverage.cpp index 9c74b5ea5c2..9f534e4f51d 100644 --- a/lib/Transforms/Instrumentation/SanitizerCoverage.cpp +++ b/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 Indices;