mirror of
https://github.com/capstone-engine/llvm-capstone.git
synced 2024-11-27 15:41:46 +00:00
From Vassil Vassilev: add checks for removing Decls for more use cases.
llvm-svn: 144094
This commit is contained in:
parent
475ab6ad7b
commit
fbc7b98e58
@ -1622,7 +1622,7 @@ FunctionDecl::setPreviousDeclaration(FunctionDecl *PrevDecl) {
|
||||
FunTmpl->setPreviousDeclaration(PrevFunTmpl);
|
||||
}
|
||||
|
||||
if (PrevDecl->IsInline)
|
||||
if (PrevDecl && PrevDecl->IsInline)
|
||||
IsInline = true;
|
||||
}
|
||||
|
||||
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user