This is an archive of the discontinued LLVM Phabricator instance.

Fix null pointer segfault when calling dump() on a DeclStmt containing a VarDecl.
ClosedPublic

Authored by alexmc on May 1 2014, 9:47 PM.

Details

Reviewers
jordan_rose

Diff Detail

Event Timeline

alexmc updated this revision to Diff 9029.May 1 2014, 9:47 PM
alexmc retitled this revision from to Fix null pointer segfault when calling dump() on a DeclStmt containing a VarDecl..
alexmc added a reviewer: jordan_rose.
alexmc added a subscriber: Unknown Object (MLST).
jordan_rose edited edge metadata.May 2 2014, 9:12 AM

Question: why do we not have a SourceManager here?

If you call Stmt::dump(), it creates an ASTDumper without a SourceManager: ASTDumper.cpp:2163 http://clang.llvm.org/doxygen/ASTDumper_8cpp_source.html#l02162

Note that the other place SM is dereferenced in that file (ASTDumper.cpp:189) we check SM for null before using it.

jordan_rose accepted this revision.May 2 2014, 1:05 PM
jordan_rose edited edge metadata.

Okay, thanks for the explanation. Please commit.

This revision is now accepted and ready to land.May 2 2014, 1:05 PM
alexmc closed this revision.May 2 2014, 1:34 PM

Submitted as r207867