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/ASTMerge.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/ASTMerge.cpp')
-rw-r--r-- | clang/lib/Frontend/ASTMerge.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/clang/lib/Frontend/ASTMerge.cpp b/clang/lib/Frontend/ASTMerge.cpp index 2228ea45df3..24658615a9a 100644 --- a/clang/lib/Frontend/ASTMerge.cpp +++ b/clang/lib/Frontend/ASTMerge.cpp @@ -37,7 +37,8 @@ void ASTMergeAction::ExecuteAction() { CI.getDiagnostics().SetArgToStringFn(&FormatASTNodeDiagnosticArgument, &CI.getASTContext()); for (unsigned I = 0, N = ASTFiles.size(); I != N; ++I) { - ASTUnit *Unit = ASTUnit::LoadFromPCHFile(ASTFiles[I], CI.getDiagnostics(), + ASTUnit *Unit = ASTUnit::LoadFromPCHFile(ASTFiles[I], + UnownedDiag(CI.getDiagnostics()), false); if (!Unit) continue; |