From: Fariborz Jahanian Date: Fri, 29 Oct 2010 19:49:13 +0000 (+0000) Subject: If Consumer object failed to create due to some X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=d305719f9b7e154a822ff6688c663cbd32bb1d7b;p=clang If Consumer object failed to create due to some user error, fail gracefully. Fixes pr8508. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@117692 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/Frontend/FrontendAction.cpp b/lib/Frontend/FrontendAction.cpp index 26ae4b1f7f..48f115fd3e 100644 --- a/lib/Frontend/FrontendAction.cpp +++ b/lib/Frontend/FrontendAction.cpp @@ -166,6 +166,8 @@ bool FrontendAction::BeginSourceFile(CompilerInstance &CI, CI.createASTContext(); llvm::OwningPtr Consumer(CreateASTConsumer(CI, Filename)); + if (!Consumer) + goto failure; CI.getASTContext().setASTMutationListener(Consumer->GetASTMutationListener());