diff options
| author | Alex McCarthy <alexmc@google.com> | 2014-05-02 20:24:11 +0000 |
|---|---|---|
| committer | Alex McCarthy <alexmc@google.com> | 2014-05-02 20:24:11 +0000 |
| commit | e14ddef0340db8c4af8158fa177f65578180cbab (patch) | |
| tree | 614e31efdb724bee5212914be556773664d0bd4b | |
| parent | c475e1bc7784be136b28b8791a69492b31c8fabe (diff) | |
| download | bcm5719-llvm-e14ddef0340db8c4af8158fa177f65578180cbab.tar.gz bcm5719-llvm-e14ddef0340db8c4af8158fa177f65578180cbab.zip | |
Fix null pointer segfault when calling dump() on a DeclStmt containing a VarDecl.
llvm-svn: 207867
| -rw-r--r-- | clang/lib/AST/ASTDumper.cpp | 3 |
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); |

