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.
git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@134518 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/source/Expression/ClangExpressionDeclMap.cpp b/source/Expression/ClangExpressionDeclMap.cpp
index 3216b65..453f4b1 100644
--- a/source/Expression/ClangExpressionDeclMap.cpp
+++ b/source/Expression/ClangExpressionDeclMap.cpp
@@ -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();