r207867 - Fix null pointer segfault when calling dump() on a DeclStmt containing a VarDecl.

Alex McCarthy alexmc at google.com
Fri May 2 13:24:11 PDT 2014


Author: alexmc
Date: Fri May  2 15:24:11 2014
New Revision: 207867

URL: http://llvm.org/viewvc/llvm-project?rev=207867&view=rev
Log:
Fix null pointer segfault when calling dump() on a DeclStmt containing a VarDecl.

Modified:
    cfe/trunk/lib/AST/ASTDumper.cpp

Modified: cfe/trunk/lib/AST/ASTDumper.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/AST/ASTDumper.cpp?rev=207867&r1=207866&r2=207867&view=diff
==============================================================================
--- cfe/trunk/lib/AST/ASTDumper.cpp (original)
+++ cfe/trunk/lib/AST/ASTDumper.cpp Fri May  2 15:24:11 2014
@@ -444,6 +444,9 @@ void ASTDumper::dumpPointer(const void *
 }
 
 void ASTDumper::dumpLocation(SourceLocation Loc) {
+  if (!SM)
+    return;
+
   ColorScope Color(*this, LocationColor);
   SourceLocation SpellingLoc = SM->getSpellingLoc(Loc);
 





More information about the cfe-commits mailing list