summaryrefslogtreecommitdiffstats
path: root/clang
diff options
context:
space:
mode:
authorAlex McCarthy <alexmc@google.com>2014-05-02 20:24:11 +0000
committerAlex McCarthy <alexmc@google.com>2014-05-02 20:24:11 +0000
commite14ddef0340db8c4af8158fa177f65578180cbab (patch)
tree614e31efdb724bee5212914be556773664d0bd4b /clang
parentc475e1bc7784be136b28b8791a69492b31c8fabe (diff)
downloadbcm5719-llvm-e14ddef0340db8c4af8158fa177f65578180cbab.tar.gz
bcm5719-llvm-e14ddef0340db8c4af8158fa177f65578180cbab.zip
Fix null pointer segfault when calling dump() on a DeclStmt containing a VarDecl.
llvm-svn: 207867
Diffstat (limited to 'clang')
-rw-r--r--clang/lib/AST/ASTDumper.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/clang/lib/AST/ASTDumper.cpp b/clang/lib/AST/ASTDumper.cpp
index 39019792ee5..76699bd5688 100644
--- a/clang/lib/AST/ASTDumper.cpp
+++ b/clang/lib/AST/ASTDumper.cpp
@@ -444,6 +444,9 @@ void ASTDumper::dumpPointer(const void *Ptr) {
}
void ASTDumper::dumpLocation(SourceLocation Loc) {
+ if (!SM)
+ return;
+
ColorScope Color(*this, LocationColor);
SourceLocation SpellingLoc = SM->getSpellingLoc(Loc);
OpenPOWER on IntegriCloud