aboutsummaryrefslogtreecommitdiff
path: root/include/clang
diff options
context:
space:
mode:
authorTed Kremenek <kremenek@apple.com>2009-07-31 00:34:52 +0000
committerTed Kremenek <kremenek@apple.com>2009-07-31 00:34:52 +0000
commit82ec2e99084996eecbdf3a304f3cbba8c16c2f6b (patch)
tree7e1eee769048e7f87c3cda3773c96504f6577dba /include/clang
parent04d4beee4b86af20a9e4457023d3925cab8f9908 (diff)
Fix use-after-release bug introduced in r77585 where the PathDiagnosticClient
created by AnalysisConsumer would be released by an instance of AnalysisManager and then reused by later instances of AnalysisManager. Ownership of the PathDiagnosticClient now belongs (for now) in AnalysisConsumer. We also need this layering (for now) because the HTMLDiagnostiClient requires that the entire translation unit be processed before emitting diagnostics. This is done in its destructor (which should also be fixed, but that is another issue). This fixes PR 4653. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@77648 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/clang')
-rw-r--r--include/clang/Analysis/PathSensitive/AnalysisManager.h5
1 files changed, 2 insertions, 3 deletions
diff --git a/include/clang/Analysis/PathSensitive/AnalysisManager.h b/include/clang/Analysis/PathSensitive/AnalysisManager.h
index f1b413633e..e7371de656 100644
--- a/include/clang/Analysis/PathSensitive/AnalysisManager.h
+++ b/include/clang/Analysis/PathSensitive/AnalysisManager.h
@@ -29,7 +29,7 @@ class AnalysisManager : public BugReporterData {
Diagnostic &Diags;
const LangOptions &LangInfo;
- llvm::OwningPtr<PathDiagnosticClient> PD;
+ PathDiagnosticClient *PD;
// Configurable components creators.
StoreManagerCreator CreateStoreMgr;
@@ -51,7 +51,6 @@ public:
ConstraintManagerCreator constraintmgr,
bool displayProgress, bool vizdot, bool vizubi,
bool purge, bool eager, bool trim)
-
: Ctx(ctx), Diags(diags), LangInfo(lang), PD(pd),
CreateStoreMgr(storemgr), CreateConstraintMgr(constraintmgr),
AScope(ScopeDecl), DisplayedFunction(!displayProgress),
@@ -124,7 +123,7 @@ public:
}
virtual PathDiagnosticClient *getPathDiagnosticClient() {
- return PD.get();
+ return PD;
}
bool shouldVisualizeGraphviz() const { return VisualizeEGDot; }