From 60e2c6aa433e6cbb3eb13377c9e8904209416267 Mon Sep 17 00:00:00 2001 From: Johnny Chen Date: Wed, 30 Nov 2011 23:18:53 +0000 Subject: rdar://problem/10501020 ClangASTSource::~ClangASTSource() was calling ClangASTContext *scratch_clang_ast_context = m_target->GetScratchClangASTContext(); which had the side effect of deleting this very ClangASTSource instance. Not good. Change it to // We are in the process of destruction, don't create clang ast context on demand // by passing false to Target::GetScratchClangASTContext(create_on_demand). ClangASTContext *scratch_clang_ast_context = m_target->GetScratchClangASTContext(false); The Target::GetScratchClangASTContext(bool create_on_demand=true) has a new signature. llvm-svn: 145537 --- lldb/source/Expression/ClangASTSource.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'lldb/source/Expression/ClangASTSource.cpp') diff --git a/lldb/source/Expression/ClangASTSource.cpp b/lldb/source/Expression/ClangASTSource.cpp index db08539b977..ca97fc19d34 100644 --- a/lldb/source/Expression/ClangASTSource.cpp +++ b/lldb/source/Expression/ClangASTSource.cpp @@ -27,7 +27,9 @@ ClangASTSource::~ClangASTSource() { m_ast_importer->ForgetDestination(m_ast_context); - ClangASTContext *scratch_clang_ast_context = m_target->GetScratchClangASTContext(); + // We are in the process of destruction, don't create clang ast context on demand + // by passing false to Target::GetScratchClangASTContext(create_on_demand). + ClangASTContext *scratch_clang_ast_context = m_target->GetScratchClangASTContext(false); if (!scratch_clang_ast_context) return; -- cgit v1.2.3