summaryrefslogtreecommitdiffstats
path: root/llvm/lib/IR
diff options
context:
space:
mode:
authorDavide Italiano <davide@freebsd.org>2015-05-04 18:08:35 +0000
committerDavide Italiano <davide@freebsd.org>2015-05-04 18:08:35 +0000
commite197d4fbb66922fa67d4ff3e703c3b81b43a50a0 (patch)
tree2c758c2c3238ce944f698948daa7b0cfa3805e19 /llvm/lib/IR
parent8d8146fa73fcb7bd75c976605b395605d685bbc5 (diff)
downloadbcm5719-llvm-e197d4fbb66922fa67d4ff3e703c3b81b43a50a0.tar.gz
bcm5719-llvm-e197d4fbb66922fa67d4ff3e703c3b81b43a50a0.zip
[IR/Diagnostic] Assert that DebugLoc is valid before accessing.
PR: 23380 Differential Revision: http://reviews.llvm.org/D9464 Reviewed by: dexonsmith llvm-svn: 236435
Diffstat (limited to 'llvm/lib/IR')
-rw-r--r--llvm/lib/IR/DiagnosticInfo.cpp1
1 files changed, 1 insertions, 0 deletions
diff --git a/llvm/lib/IR/DiagnosticInfo.cpp b/llvm/lib/IR/DiagnosticInfo.cpp
index b161d07ac98..45be100ae05 100644
--- a/llvm/lib/IR/DiagnosticInfo.cpp
+++ b/llvm/lib/IR/DiagnosticInfo.cpp
@@ -136,6 +136,7 @@ void DiagnosticInfoOptimizationBase::getLocation(StringRef *Filename,
unsigned *Line,
unsigned *Column) const {
DILocation *L = getDebugLoc();
+ assert(L != nullptr && "debug location is invalid");
*Filename = L->getFilename();
*Line = L->getLine();
*Column = L->getColumn();
OpenPOWER on IntegriCloud