[Lldb-commits] [lldb] r134518 - in /lldb/trunk/source: Expression/ClangExpressionDeclMap.cpp Symbol/ClangASTImporter.cpp
Greg Clayton
gclayton at apple.com
Wed Jul 6 11:55:08 PDT 2011
Author: gclayton
Date: Wed Jul 6 13:55:08 2011
New Revision: 134518
URL: http://llvm.org/viewvc/llvm-project?rev=134518&view=rev
Log:
Fixed an issue that was causing us to crash when evaluating expressions for
objective C or C++ methods when "self" or "this" were in scope, but had
invalid locations in a DWARF location list. The lack of a valid value caused
us to use an invalid type value and then we tried to import that invalid
value and we would crash.
Modified:
lldb/trunk/source/Expression/ClangExpressionDeclMap.cpp
lldb/trunk/source/Symbol/ClangASTImporter.cpp
Modified: lldb/trunk/source/Expression/ClangExpressionDeclMap.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Expression/ClangExpressionDeclMap.cpp?rev=134518&r1=134517&r2=134518&view=diff
==============================================================================
--- lldb/trunk/source/Expression/ClangExpressionDeclMap.cpp (original)
+++ lldb/trunk/source/Expression/ClangExpressionDeclMap.cpp Wed Jul 6 13:55:08 2011
@@ -1831,7 +1831,9 @@
lldb::VariableSP this_var = vars->FindVariable(ConstString("this"));
- if (!this_var)
+ if (!this_var ||
+ !this_var->IsInScope(m_parser_vars->m_exe_ctx->frame) ||
+ !this_var->LocationIsValidForFrame (m_parser_vars->m_exe_ctx->frame))
return;
Type *this_type = this_var->GetType();
@@ -1886,7 +1888,9 @@
lldb::VariableSP self_var = vars->FindVariable(ConstString("self"));
- if (!self_var)
+ if (!self_var ||
+ !self_var->IsInScope(m_parser_vars->m_exe_ctx->frame) ||
+ !self_var->LocationIsValidForFrame (m_parser_vars->m_exe_ctx->frame))
return;
Type *self_type = self_var->GetType();
Modified: lldb/trunk/source/Symbol/ClangASTImporter.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Symbol/ClangASTImporter.cpp?rev=134518&r1=134517&r2=134518&view=diff
==============================================================================
--- lldb/trunk/source/Symbol/ClangASTImporter.cpp (original)
+++ lldb/trunk/source/Symbol/ClangASTImporter.cpp Wed Jul 6 13:55:08 2011
@@ -18,23 +18,26 @@
ClangASTImporter::CopyType (clang::ASTContext *src_ast,
clang::QualType type)
{
- MinionSP minion = GetMinion(src_ast, false);
-
- return minion->Import(type);
+ MinionSP minion_sp (GetMinion(src_ast, false));
+ if (minion_sp)
+ return minion_sp->Import(type);
+ return QualType();
}
clang::Decl *
ClangASTImporter::CopyDecl (clang::ASTContext *src_ast,
clang::Decl *decl)
{
- MinionSP minion;
+ MinionSP minion_sp;
if (isa<clang::NamespaceDecl>(decl))
- minion = GetMinion(src_ast, true);
+ minion_sp = GetMinion(src_ast, true);
else
- minion = GetMinion(src_ast, false);
+ minion_sp = GetMinion(src_ast, false);
- return minion->Import(decl);
+ if (minion_sp)
+ return minion_sp->Import(decl);
+ return NULL;
}
const clang::DeclContext *
@@ -53,9 +56,9 @@
if (!ClangASTContext::GetCompleteDecl(context_decl_origin.ctx, context_decl_origin.decl))
return NULL;
- MinionSP minion = GetMinion(context_decl_origin.ctx, false);
-
- minion->ImportDefinition(context_decl_origin.decl);
+ MinionSP minion_sp (GetMinion(context_decl_origin.ctx, false));
+ if (minion_sp)
+ minion_sp->ImportDefinition(context_decl_origin.decl);
return decl_context;
}
More information about the lldb-commits
mailing list