If a TST_typename has a null type, mark the declarator invalid. Prevents

some downstream crashes, among them rdar://problem/8229840.

llvm-svn: 109850
This commit is contained in:
John McCall 2010-07-30 05:17:22 +00:00
parent 45d494785d
commit 0925714eca
1 changed files with 4 additions and 2 deletions

View File

@ -298,8 +298,10 @@ static QualType ConvertDeclSpecToType(Sema &TheSema,
DS.getTypeSpecSign() == 0 && DS.getTypeSpecSign() == 0 &&
"Can't handle qualifiers on typedef names yet!"); "Can't handle qualifiers on typedef names yet!");
Result = TheSema.GetTypeFromParser(DS.getTypeRep()); Result = TheSema.GetTypeFromParser(DS.getTypeRep());
if (Result.isNull())
if (DeclSpec::ProtocolQualifierListTy PQ = DS.getProtocolQualifiers()) { TheDeclarator.setInvalidType(true);
else if (DeclSpec::ProtocolQualifierListTy PQ
= DS.getProtocolQualifiers()) {
if (const ObjCObjectType *ObjT = Result->getAs<ObjCObjectType>()) { if (const ObjCObjectType *ObjT = Result->getAs<ObjCObjectType>()) {
// Silently drop any existing protocol qualifiers. // Silently drop any existing protocol qualifiers.
// TODO: determine whether that's the right thing to do. // TODO: determine whether that's the right thing to do.