From d305719f9b7e154a822ff6688c663cbd32bb1d7b Mon Sep 17 00:00:00 2001 From: Fariborz Jahanian Date: Fri, 29 Oct 2010 19:49:13 +0000 Subject: [PATCH] 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 --- lib/Frontend/FrontendAction.cpp | 2 ++ 1 file changed, 2 insertions(+) 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()); -- 2.40.0