r254867 - Fix crash in ASTDumper when dumping NamedDecl with NULL getQualifier().
Dawn Perchik via cfe-commits
cfe-commits at lists.llvm.org
Sat Dec 5 14:37:55 PST 2015
Author: dperchik
Date: Sat Dec 5 16:37:55 2015
New Revision: 254867
URL: http://llvm.org/viewvc/llvm-project?rev=254867&view=rev
Log:
Fix crash in ASTDumper when dumping NamedDecl with NULL getQualifier().
Reviewed by: aaron.ballman
Subscribers: cfe-commits
Differential Revision: http://reviews.llvm.org/D15254
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=254867&r1=254866&r2=254867&view=diff
==============================================================================
--- cfe/trunk/lib/AST/ASTDumper.cpp (original)
+++ cfe/trunk/lib/AST/ASTDumper.cpp Sat Dec 5 16:37:55 2015
@@ -1385,20 +1385,23 @@ void ASTDumper::VisitTemplateTemplatePar
void ASTDumper::VisitUsingDecl(const UsingDecl *D) {
OS << ' ';
- D->getQualifier()->print(OS, D->getASTContext().getPrintingPolicy());
+ if (D->getQualifier())
+ D->getQualifier()->print(OS, D->getASTContext().getPrintingPolicy());
OS << D->getNameAsString();
}
void ASTDumper::VisitUnresolvedUsingTypenameDecl(
const UnresolvedUsingTypenameDecl *D) {
OS << ' ';
- D->getQualifier()->print(OS, D->getASTContext().getPrintingPolicy());
+ if (D->getQualifier())
+ D->getQualifier()->print(OS, D->getASTContext().getPrintingPolicy());
OS << D->getNameAsString();
}
void ASTDumper::VisitUnresolvedUsingValueDecl(const UnresolvedUsingValueDecl *D) {
OS << ' ';
- D->getQualifier()->print(OS, D->getASTContext().getPrintingPolicy());
+ if (D->getQualifier())
+ D->getQualifier()->print(OS, D->getASTContext().getPrintingPolicy());
OS << D->getNameAsString();
dumpType(D->getType());
}
More information about the cfe-commits
mailing list