From Vassil Vassilev: add checks for removing Decls for more use cases.

llvm-svn: 144094
This commit is contained in:
Axel Naumann 2011-11-08 18:21:06 +00:00
parent 475ab6ad7b
commit fbc7b98e58
2 changed files with 3 additions and 2 deletions

View File

@ -1622,7 +1622,7 @@ FunctionDecl::setPreviousDeclaration(FunctionDecl *PrevDecl) {
FunTmpl->setPreviousDeclaration(PrevFunTmpl);
}
if (PrevDecl->IsInline)
if (PrevDecl && PrevDecl->IsInline)
IsInline = true;
}

View File

@ -987,7 +987,8 @@ void DeclContext::removeDecl(Decl *D) {
StoredDeclsMap::iterator Pos = Map->find(ND->getDeclName());
assert(Pos != Map->end() && "no lookup entry for decl");
Pos->second.remove(ND);
if (Pos->second.getAsVector() || Pos->second.getAsDecl() == ND)
Pos->second.remove(ND);
}
}