[PATCH] Fix null pointer segfault when calling dump() on a DeclStmt containing a VarDecl.

Alex McCarthy alexmc at google.com
Thu May 1 21:47:25 PDT 2014


Hi jordan_rose,

http://reviews.llvm.org/D3589

Files:
  lib/AST/ASTDumper.cpp

Index: lib/AST/ASTDumper.cpp
===================================================================
--- lib/AST/ASTDumper.cpp
+++ lib/AST/ASTDumper.cpp
@@ -444,6 +444,9 @@
 }
 
 void ASTDumper::dumpLocation(SourceLocation Loc) {
+  if (!SM)
+    return;
+
   ColorScope Color(*this, LocationColor);
   SourceLocation SpellingLoc = SM->getSpellingLoc(Loc);
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D3589.9029.patch
Type: text/x-patch
Size: 355 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20140502/5256c4fd/attachment.bin>


More information about the cfe-commits mailing list