diff options
author | Fariborz Jahanian <fjahanian@apple.com> | 2010-10-29 19:49:13 +0000 |
---|---|---|
committer | Fariborz Jahanian <fjahanian@apple.com> | 2010-10-29 19:49:13 +0000 |
commit | d305719f9b7e154a822ff6688c663cbd32bb1d7b (patch) | |
tree | 0a69472975e19cd83ee9ff21191052883fde36ce /lib/Frontend/FrontendAction.cpp | |
parent | 0483dceea00e47eeef0f3e7aa2bf72d71dc469ac (diff) |
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
Diffstat (limited to 'lib/Frontend/FrontendAction.cpp')
-rw-r--r-- | lib/Frontend/FrontendAction.cpp | 2 |
1 files changed, 2 insertions, 0 deletions
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<ASTConsumer> Consumer(CreateASTConsumer(CI, Filename)); + if (!Consumer) + goto failure; CI.getASTContext().setASTMutationListener(Consumer->GetASTMutationListener()); |