From ffc12850cfd532f5879e7ac0cd456bd6e18236b7 Mon Sep 17 00:00:00 2001 From: Sean Callanan Date: Fri, 23 Aug 2013 00:36:14 +0000 Subject: Make sure that ClangExpressionDeclMap doesn't live beyont parsing. This is important because all the ClangASTImporter::Minions for a parser's ASTContext are cleared when ClangExpressionDeclMap is deleted. This resolves many hard-to-reproduce crashes, especially ones involving breakpoint conditions. llvm-svn: 189080 --- lldb/source/Expression/ClangUserExpression.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'lldb/source/Expression/ClangUserExpression.cpp') diff --git a/lldb/source/Expression/ClangUserExpression.cpp b/lldb/source/Expression/ClangUserExpression.cpp index 7f09f6fa094..1e52ce2828c 100644 --- a/lldb/source/Expression/ClangUserExpression.cpp +++ b/lldb/source/Expression/ClangUserExpression.cpp @@ -508,6 +508,9 @@ ClangUserExpression::Parse (Stream &error_stream, if (!m_expr_decl_map->WillParse(exe_ctx, m_materializer_ap.get())) { error_stream.PutCString ("error: current process state is unsuitable for expression parsing\n"); + + m_expr_decl_map.reset(); // We are being careful here in the case of breakpoint conditions. + return false; } @@ -525,7 +528,7 @@ ClangUserExpression::Parse (Stream &error_stream, { error_stream.Printf ("error: %d errors parsing expression\n", num_errors); - m_expr_decl_map->DidParse(); + m_expr_decl_map.reset(); // We are being careful here in the case of breakpoint conditions. return false; } @@ -540,6 +543,8 @@ ClangUserExpression::Parse (Stream &error_stream, exe_ctx, m_can_interpret, execution_policy); + + m_expr_decl_map.reset(); // Make this go away since we don't need any of its state after parsing. This also gets rid of any ClangASTImporter::Minions. if (jit_error.Success()) { -- cgit v1.2.3