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 26ae4b1..48f115f 100644
--- a/lib/Frontend/FrontendAction.cpp
+++ b/lib/Frontend/FrontendAction.cpp
@@ -166,6 +166,8 @@
     CI.createASTContext();
 
     llvm::OwningPtr<ASTConsumer> Consumer(CreateASTConsumer(CI, Filename));
+    if (!Consumer)
+      goto failure;
 
     CI.getASTContext().setASTMutationListener(Consumer->GetASTMutationListener());