diff options
| author | Sean Callanan <scallanan@apple.com> | 2012-03-21 17:13:20 +0000 |
|---|---|---|
| committer | Sean Callanan <scallanan@apple.com> | 2012-03-21 17:13:20 +0000 |
| commit | e2d4748ae35332c81ec7883d0f4fb8c532eda686 (patch) | |
| tree | 244160fc1a336a1dbd010ee68ced21401a569d61 /lldb/source/Expression | |
| parent | 3ba24bab1cd1a7ad127298dc869736e24abe5206 (diff) | |
| download | bcm5719-llvm-e2d4748ae35332c81ec7883d0f4fb8c532eda686.tar.gz bcm5719-llvm-e2d4748ae35332c81ec7883d0f4fb8c532eda686.zip | |
Added some hardening to make sure that we don't
use QualType contents unchecked.
llvm-svn: 153201
Diffstat (limited to 'lldb/source/Expression')
| -rw-r--r-- | lldb/source/Expression/ClangASTSource.cpp | 2 | ||||
| -rw-r--r-- | lldb/source/Expression/ClangExpressionDeclMap.cpp | 3 |
2 files changed, 5 insertions, 0 deletions
diff --git a/lldb/source/Expression/ClangASTSource.cpp b/lldb/source/Expression/ClangASTSource.cpp index d50e80854e2..08f63b5c8f8 100644 --- a/lldb/source/Expression/ClangASTSource.cpp +++ b/lldb/source/Expression/ClangASTSource.cpp @@ -1349,6 +1349,8 @@ NameSearchContext::AddVarDecl(void *type) clang::NamedDecl * NameSearchContext::AddFunDecl (void *type) { + assert (type && "Type for variable must be non-NULL!"); + clang::FunctionDecl *func_decl = FunctionDecl::Create (*m_ast_source.m_ast_context, const_cast<DeclContext*>(m_decl_context), SourceLocation(), diff --git a/lldb/source/Expression/ClangExpressionDeclMap.cpp b/lldb/source/Expression/ClangExpressionDeclMap.cpp index ccb5266dfbd..dd6a80b7d91 100644 --- a/lldb/source/Expression/ClangExpressionDeclMap.cpp +++ b/lldb/source/Expression/ClangExpressionDeclMap.cpp @@ -2902,6 +2902,9 @@ ClangExpressionDeclMap::AddOneVariable (NameSearchContext &context, VariableSP v clang::QualType parser_opaque_type = QualType::getFromOpaquePtr(pt.GetOpaqueQualType()); + if (parser_opaque_type.isNull()) + return; + if (const clang::Type *parser_type = parser_opaque_type.getTypePtr()) { if (const TagType *tag_type = dyn_cast<TagType>(parser_type)) |

