Bad cast...need to use dyn_cast_or_null. Also changed Sema::InitBuiltinVaListType (which had the same bug).

llvm-svn: 43023
This commit is contained in:
Steve Naroff 2007-10-16 00:00:18 +00:00
parent 76a9427783
commit 698495522d
3 changed files with 4 additions and 5 deletions

View File

@ -154,7 +154,7 @@ void Sema::InitBuiltinVaListType()
IdentifierInfo *VaIdent = &Context.Idents.get("__builtin_va_list");
ScopedDecl *VaDecl = LookupScopedDecl(VaIdent, Decl::IDNS_Ordinary,
SourceLocation(), TUScope);
TypedefDecl *VaTypedef = cast<TypedefDecl>(VaDecl);
TypedefDecl *VaTypedef = dyn_cast_or_null<TypedefDecl>(VaDecl);
Context.setBuiltinVaListType(Context.getTypedefType(VaTypedef));
}

View File

@ -1896,9 +1896,9 @@ Sema::ExprResult Sema::ParseObjCStringLiteral(ExprTy *string) {
IdentifierInfo *NSIdent = &Context.Idents.get("NSConstantString");
ScopedDecl *IFace = LookupScopedDecl(NSIdent, Decl::IDNS_Ordinary,
SourceLocation(), TUScope);
ObjcInterfaceDecl *stringInterface = cast<ObjcInterfaceDecl>(IFace);
assert(stringInterface && "missing '@interface NSConstantString'");
Context.setObjcConstantStringInterface(stringInterface);
ObjcInterfaceDecl *strIFace = dyn_cast_or_null<ObjcInterfaceDecl>(IFace);
assert(strIFace && "missing '@interface NSConstantString'");
Context.setObjcConstantStringInterface(strIFace);
}
QualType t = Context.getObjcConstantStringInterface();
t = Context.getPointerType(t);

View File

@ -742,7 +742,6 @@
08FB7793FE84155DC02AAC07 /* Project object */ = {
isa = PBXProject;
buildConfigurationList = 1DEB923508733DC60010E9CD /* Build configuration list for PBXProject "clang" */;
compatibilityVersion = "Xcode 2.4";
hasScannedForEncodings = 1;
mainGroup = 08FB7794FE84155DC02AAC07 /* clang */;
projectDirPath = "";