[llvm] r236435 - [IR/Diagnostic] Assert that DebugLoc is valid before accessing.
Davide Italiano
davide at freebsd.org
Mon May 4 11:08:35 PDT 2015
Author: davide
Date: Mon May 4 13:08:35 2015
New Revision: 236435
URL: http://llvm.org/viewvc/llvm-project?rev=236435&view=rev
Log:
[IR/Diagnostic] Assert that DebugLoc is valid before accessing.
PR: 23380
Differential Revision: http://reviews.llvm.org/D9464
Reviewed by: dexonsmith
Modified:
llvm/trunk/lib/IR/DiagnosticInfo.cpp
Modified: llvm/trunk/lib/IR/DiagnosticInfo.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/IR/DiagnosticInfo.cpp?rev=236435&r1=236434&r2=236435&view=diff
==============================================================================
--- llvm/trunk/lib/IR/DiagnosticInfo.cpp (original)
+++ llvm/trunk/lib/IR/DiagnosticInfo.cpp Mon May 4 13:08:35 2015
@@ -136,6 +136,7 @@ void DiagnosticInfoOptimizationBase::get
unsigned *Line,
unsigned *Column) const {
DILocation *L = getDebugLoc();
+ assert(L != nullptr && "debug location is invalid");
*Filename = L->getFilename();
*Line = L->getLine();
*Column = L->getColumn();
More information about the llvm-commits
mailing list