diff options
author | Sean Callanan <scallanan@apple.com> | 2010-11-20 02:19:29 +0000 |
---|---|---|
committer | Sean Callanan <scallanan@apple.com> | 2010-11-20 02:19:29 +0000 |
commit | a3aa0cf6e698552ea7310df45575b43a720d1baf (patch) | |
tree | 84c3f7580908e065735971e86061224b4e35c1f2 /lldb/source/Expression/ClangExpressionDeclMap.cpp | |
parent | 80eee3a989d6717711b41c66d8b49ffaa5675c9b (diff) | |
download | bcm5719-llvm-a3aa0cf6e698552ea7310df45575b43a720d1baf.tar.gz bcm5719-llvm-a3aa0cf6e698552ea7310df45575b43a720d1baf.zip |
Made GetVariableValue() more robust in the face
of failures in the AST importer. Also ensured
that a variable will not be blindly added if
GetVariableValue() returns an error.
llvm-svn: 119889
Diffstat (limited to 'lldb/source/Expression/ClangExpressionDeclMap.cpp')
-rw-r--r-- | lldb/source/Expression/ClangExpressionDeclMap.cpp | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/lldb/source/Expression/ClangExpressionDeclMap.cpp b/lldb/source/Expression/ClangExpressionDeclMap.cpp index f2d2bc96248..b6427cc7c08 100644 --- a/lldb/source/Expression/ClangExpressionDeclMap.cpp +++ b/lldb/source/Expression/ClangExpressionDeclMap.cpp @@ -1220,6 +1220,14 @@ ClangExpressionDeclMap::GetVariableValue { type_to_use = GuardedCopyType(parser_ast_context, var_ast_context, var_opaque_type); + if (!type_to_use) + { + if (log) + log->Printf("Couldn't copy a variable's type into the parser's AST context"); + + return NULL; + } + if (parser_type) *parser_type = TypeFromParser(type_to_use, parser_ast_context); } @@ -1271,6 +1279,9 @@ ClangExpressionDeclMap::AddOneVariable(NameSearchContext &context, &ut, &pt); + if (!var_location) + return; + NamedDecl *var_decl = context.AddVarDecl(pt.GetOpaqueQualType()); ClangExpressionVariable &entity(m_found_entities.VariableAtIndex(m_found_entities.CreateVariable())); |