Added some hardening to make sure that we don't
use QualType contents unchecked. llvm-svn: 153201
This commit is contained in:
parent
3ba24bab1c
commit
e2d4748ae3
|
@ -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(),
|
||||
|
|
|
@ -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))
|
||||
|
|
Loading…
Reference in New Issue