Fixed a crasher that could happen if:

- you have a type that contains a typedef to a VectorType or an ExtVectorType
- that type is returned from an ARM function that LLDB steps over so we try to figure out the return type
- we try to determine if the type is a homogeneous aggregate type and we crash

We get not using getAs() when we should have been and using llvm::cast caused an assertion crash when the typedef type didn't return a valid VectorType or ExtVectorType.

<rdar://problem/19646550>

llvm-svn: 228771
This commit is contained in:
Greg Clayton 2015-02-11 00:04:33 +00:00
parent 78d1c3fcb6
commit e3c65509cd
1 changed files with 1 additions and 1 deletions

View File

@ -493,7 +493,7 @@ ClangASTType::IsHomogeneousAggregate (ClangASTType* base_type_ptr) const
}
else if (field_qual_type->isVectorType() || field_qual_type->isExtVectorType())
{
const clang::VectorType *array = llvm::cast<clang::VectorType>(field_qual_type.getTypePtr());
const clang::VectorType *array = field_qual_type.getTypePtr()->getAs<clang::VectorType>();
if (array && array->getNumElements() <= 4)
{
if (num_fields == 0)