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 | |
| parent | 80eee3a989d6717711b41c66d8b49ffaa5675c9b (diff) | |
| download | llvm-a3aa0cf6e698552ea7310df45575b43a720d1baf.zip llvm-a3aa0cf6e698552ea7310df45575b43a720d1baf.tar.gz llvm-a3aa0cf6e698552ea7310df45575b43a720d1baf.tar.bz2 | |
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
| -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 f2d2bc9..b6427cc 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())); |
