Fix mem corruption: iterator might be invalidated by insertion.

This commit is contained in:
Axel Naumann 2014-09-18 23:22:02 +02:00 committed by sftnight
parent fa7ce40d67
commit 82c69767d9

View File

@ -119,13 +119,13 @@ namespace cling {
}
if (shouldSkip(D)) {
skipCurrentDecl(true);
Insert.first->second = false;
m_Visited[getCanonicalOrNamespace(D)] = false;
} else {
clang::DeclVisitor<ForwardDeclPrinter>::Visit(D);
if (m_SkipFlag) {
// D was not good, flag it.
skipCurrentDecl(true);
Insert.first->second = false;
m_Visited[getCanonicalOrNamespace(D)] = false;
}
}
}