aboutsummaryrefslogtreecommitdiff
path: root/lib/Frontend/FrontendAction.cpp
diff options
context:
space:
mode:
authorDouglas Gregor <dgregor@apple.com>2010-04-05 21:10:19 +0000
committerDouglas Gregor <dgregor@apple.com>2010-04-05 21:10:19 +0000
commit3687e9d3a5dbfa9963af02a49a2b139d91310813 (patch)
treeade3e3fa898569e289eb9dd3e4642b1724d2195e /lib/Frontend/FrontendAction.cpp
parent4800ea6ff8017cf803c32a5fd63b94c0614014e3 (diff)
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>. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@100464 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Frontend/FrontendAction.cpp')
-rw-r--r--lib/Frontend/FrontendAction.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/Frontend/FrontendAction.cpp b/lib/Frontend/FrontendAction.cpp
index 110612d03b..4c2b1e9b82 100644
--- a/lib/Frontend/FrontendAction.cpp
+++ b/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;