[Lldb-commits] [lldb] r189080 - Make sure that ClangExpressionDeclMap doesn't

Sean Callanan scallanan at apple.com
Thu Aug 22 17:36:14 PDT 2013


Author: spyffe
Date: Thu Aug 22 19:36:14 2013
New Revision: 189080

URL: http://llvm.org/viewvc/llvm-project?rev=189080&view=rev
Log:
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.

<rdar://problem/14775391>

Modified:
    lldb/trunk/source/Expression/ClangUserExpression.cpp

Modified: lldb/trunk/source/Expression/ClangUserExpression.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Expression/ClangUserExpression.cpp?rev=189080&r1=189079&r2=189080&view=diff
==============================================================================
--- lldb/trunk/source/Expression/ClangUserExpression.cpp (original)
+++ lldb/trunk/source/Expression/ClangUserExpression.cpp Thu Aug 22 19:36:14 2013
@@ -508,6 +508,9 @@ ClangUserExpression::Parse (Stream &erro
     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 &erro
     {
         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 &erro
                                                   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())
     {





More information about the lldb-commits mailing list