[Lldb-commits] [lldb] r138499 - /lldb/trunk/source/Expression/ClangUserExpression.cpp

Sean Callanan scallanan at apple.com
Wed Aug 24 15:18:13 PDT 2011


Author: spyffe
Date: Wed Aug 24 17:18:12 2011
New Revision: 138499

URL: http://llvm.org/viewvc/llvm-project?rev=138499&view=rev
Log:
Fixed a bug where the target for an expression was
not set if the containing function could not be
found.  This caused LLDB to crash later in
expression parsing.

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=138499&r1=138498&r2=138499&view=diff
==============================================================================
--- lldb/trunk/source/Expression/ClangUserExpression.cpp (original)
+++ lldb/trunk/source/Expression/ClangUserExpression.cpp Wed Aug 24 17:18:12 2011
@@ -64,7 +64,7 @@
 
 clang::ASTConsumer *
 ClangUserExpression::ASTTransformer (clang::ASTConsumer *passthrough)
-{
+{    
     ClangASTContext *clang_ast_context = m_target->GetScratchClangASTContext();
     
     if (!clang_ast_context)
@@ -87,6 +87,8 @@
     if (!sym_ctx.function)
         return;
     
+    m_target = &exe_ctx.GetProcess()->GetTarget();
+    
     clang::DeclContext *decl_context;
     
     if (sym_ctx.block && sym_ctx.block->GetInlinedFunctionInfo())
@@ -96,9 +98,7 @@
         
     if (!decl_context)
         return;
-    
-    m_target = exe_ctx.target;
-        
+            
     if (clang::CXXMethodDecl *method_decl = llvm::dyn_cast<clang::CXXMethodDecl>(decl_context))
     {
         if (method_decl->isInstance())





More information about the lldb-commits mailing list