]> granicus.if.org Git - clang/commitdiff
Make the dumper safe against null declaration names.
authorJohn McCall <rjmccall@apple.com>
Tue, 30 Nov 2010 10:12:16 +0000 (10:12 +0000)
committerJohn McCall <rjmccall@apple.com>
Tue, 30 Nov 2010 10:12:16 +0000 (10:12 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@120421 91177308-0d34-0410-b5e6-96231b3b80d8

lib/AST/DumpXML.cpp

index ea9f1ccb7977ab0943508255aa0851aacc7dfa50..5f1a3969d1aaaaebdf2e4dc3deb9ec4932d3d022 100644 (file)
@@ -255,6 +255,9 @@ struct XMLDumper : public XMLDeclVisitor<XMLDumper>,
   }
 
   void setName(DeclarationName Name) {
+    if (!Name)
+      return set("name", "");
+
     // Common case.
     if (Name.isIdentifier())
       return set("name", Name.getAsIdentifierInfo()->getName());