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 | 2129ccf5122724470a95b01f035ad2c526c9d0b7 (patch) | |
tree | f3a8f0192dc96cc4542e5bb58957eb3f9e1bee7f /clang/lib/Frontend/FrontendAction.cpp | |
parent | 4b6ccfd9cef1c10b832d811887c675e2f90c60dc (diff) | |
download | bcm5719-llvm-2129ccf5122724470a95b01f035ad2c526c9d0b7.tar.gz bcm5719-llvm-2129ccf5122724470a95b01f035ad2c526c9d0b7.zip |
If Consumer object failed to create due to some
user error, fail gracefully. Fixes
pr8508.
llvm-svn: 117692
Diffstat (limited to 'clang/lib/Frontend/FrontendAction.cpp')
-rw-r--r-- | clang/lib/Frontend/FrontendAction.cpp | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/clang/lib/Frontend/FrontendAction.cpp b/clang/lib/Frontend/FrontendAction.cpp index 26ae4b1f7f8..48f115fd3e3 100644 --- a/clang/lib/Frontend/FrontendAction.cpp +++ b/clang/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()); |