]> granicus.if.org Git - clang/commitdiff
If Consumer object failed to create due to some
authorFariborz Jahanian <fjahanian@apple.com>
Fri, 29 Oct 2010 19:49:13 +0000 (19:49 +0000)
committerFariborz Jahanian <fjahanian@apple.com>
Fri, 29 Oct 2010 19:49:13 +0000 (19:49 +0000)
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

index 26ae4b1f7f8ea1af901ffd032230276e17f5f725..48f115fd3e3a214f6de62eb17b4726568752b05c 100644 (file)
@@ -166,6 +166,8 @@ bool FrontendAction::BeginSourceFile(CompilerInstance &CI,
     CI.createASTContext();
 
     llvm::OwningPtr<ASTConsumer> Consumer(CreateASTConsumer(CI, Filename));
+    if (!Consumer)
+      goto failure;
 
     CI.getASTContext().setASTMutationListener(Consumer->GetASTMutationListener());