diff options
author | Douglas Gregor <dgregor@apple.com> | 2010-04-05 21:10:19 +0000 |
---|---|---|
committer | Douglas Gregor <dgregor@apple.com> | 2010-04-05 21:10:19 +0000 |
commit | d03e823fb43be47f8fe3c651bfcf8a3254c3fe1c (patch) | |
tree | c6f260659019cb36d845c73fb880e27203624c9e /clang/lib/Frontend/FrontendAction.cpp | |
parent | 41e692dcf1399068dcdc90df160cb432d567ec50 (diff) | |
download | bcm5719-llvm-d03e823fb43be47f8fe3c651bfcf8a3254c3fe1c.tar.gz bcm5719-llvm-d03e823fb43be47f8fe3c651bfcf8a3254c3fe1c.zip |
Clarify the ownership semantics of the Diagnostic object used by
ASTUnit. Previously, we would end up with use-after-free errors
because the Diagnostic object would be creating in one place (say,
CIndex) and its ownership would not be transferred into the
ASTUnit. Fixes <rdar://problem/7818608>.
llvm-svn: 100464
Diffstat (limited to 'clang/lib/Frontend/FrontendAction.cpp')
-rw-r--r-- | clang/lib/Frontend/FrontendAction.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/clang/lib/Frontend/FrontendAction.cpp b/clang/lib/Frontend/FrontendAction.cpp index 110612d03b5..4c2b1e9b829 100644 --- a/clang/lib/Frontend/FrontendAction.cpp +++ b/clang/lib/Frontend/FrontendAction.cpp @@ -46,7 +46,8 @@ bool FrontendAction::BeginSourceFile(CompilerInstance &CI, assert(hasASTSupport() && "This action does not have AST support!"); std::string Error; - ASTUnit *AST = ASTUnit::LoadFromPCHFile(Filename, CI.getDiagnostics()); + ASTUnit *AST = ASTUnit::LoadFromPCHFile(Filename, + UnownedDiag(CI.getDiagnostics())); if (!AST) goto failure; |