Don't dereference null ptr if the transaction has 0 decls
git-svn-id: http://root.cern.ch/svn/root/trunk@46753 27541ba8-7e3a-0410-8455-c3a389f83636
This commit is contained in:
parent
88bd362c63
commit
09ca68c259
@ -38,6 +38,9 @@ namespace cling {
|
||||
}
|
||||
|
||||
void Transaction::dump() const {
|
||||
if (!size())
|
||||
return;
|
||||
|
||||
ASTContext& C = getFirstDecl().getSingleDecl()->getASTContext();
|
||||
PrintingPolicy Policy = C.getPrintingPolicy();
|
||||
Policy.DumpSourceManager = &C.getSourceManager();
|
||||
@ -45,6 +48,9 @@ namespace cling {
|
||||
}
|
||||
|
||||
void Transaction::dumpPretty() const {
|
||||
if (!size())
|
||||
return;
|
||||
|
||||
ASTContext& C = getFirstDecl().getSingleDecl()->getASTContext();
|
||||
PrintingPolicy Policy(C.getLangOpts());
|
||||
print(llvm::outs(), Policy, /*Indent*/0, /*PrintInstantiation*/true);
|
||||
|
Loading…
Reference in New Issue
Block a user