forked from OSchip/llvm-project
Prevent use after free caused by accessing a member into a dense set.
The member gets invalidated as elements are added to the dense set. Directly access the underlying pointer instead. Not sure how to create a test case for this :-(. Maybe Richard can help. llvm-svn: 229673
This commit is contained in:
parent
6ca8992018
commit
c0b7c80fe6
|
@ -6628,7 +6628,8 @@ ASTReader::FindExternalVisibleDeclsByName(const DeclContext *DC,
|
|||
auto Merged = MergedLookups.find(DC);
|
||||
if (Merged != MergedLookups.end()) {
|
||||
for (unsigned I = 0; I != Merged->second.size(); ++I) {
|
||||
LookUpInContexts(Merged->second[I]);
|
||||
const DeclContext *Context = Merged->second[I];
|
||||
LookUpInContexts(Context);
|
||||
// We might have just added some more merged lookups. If so, our
|
||||
// iterator is now invalid, so grab a fresh one before continuing.
|
||||
Merged = MergedLookups.find(DC);
|
||||
|
|
Loading…
Reference in New Issue